treewide reformat

This commit is contained in:
Gerg-L 2023-09-23 21:55:56 -04:00
parent de7683556e
commit fc21bf9436
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
42 changed files with 1012 additions and 876 deletions

View file

@ -1,13 +1,11 @@
{ suckless, self, ... }:
{
suckless,
self,
...
}: {
pkgs,
config,
lib,
...
}: {
}:
{
options.local.DE.dwm.enable = lib.mkEnableOption "";
config = lib.mkIf config.local.DE.dwm.enable {
@ -16,43 +14,37 @@
enable = true;
displayManager = {
sessionCommands = ''
${lib.getExe pkgs.feh} --bg-center "${self.packages.${pkgs.system}.images}/recursion.png"
${lib.getExe pkgs.feh} --bg-center "${
self.packages.${pkgs.system}.images
}/recursion.png"
${lib.getExe pkgs.numlockx}
${lib.getExe pkgs.picom} &
'';
defaultSession = "none+dwm";
};
windowManager.session =
[
{
name = "dwm";
start = ''
update_time () {
while :
do
sleep 1
xsetroot -name "$(date +"%I:%M %p")"
done
}
windowManager.session = [ {
name = "dwm";
start = ''
update_time () {
while :
do
sleep 1
xsetroot -name "$(date +"%I:%M %p")"
done
}
dont_stop() {
while type dwm >/dev/null ; do dwm && continue || break ; done
}
dont_stop() {
while type dwm >/dev/null ; do dwm && continue || break ; done
}
update_time &
dont_stop &
waitPID=$!
'';
}
];
update_time &
dont_stop &
waitPID=$!
'';
} ];
};
environment.systemPackages = builtins.attrValues {
inherit
(suckless.packages.${pkgs.system})
dmenu
dwm
st
;
inherit (suckless.packages.${pkgs.system}) dmenu dwm st;
};
};
_file = ./dwm.nix;

View file

@ -1,24 +1,24 @@
_: {
_:
{
config,
lib,
pkgs,
...
}: {
}:
{
options.local.DE.gnome.enable = lib.mkEnableOption "";
config = lib.mkIf config.local.DE.gnome.enable {
environment = {
systemPackages = [pkgs.gnome.gnome-calculator];
systemPackages = [ pkgs.gnome.gnome-calculator ];
gnome.excludePackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
gnome-photos
gnome-tour
gnome-text-editor
gnome-online-accounts
;
inherit
(pkgs.gnome)
;
inherit (pkgs.gnome)
gnome-weather
gnome-shell
gnome-disk-utility
@ -38,7 +38,7 @@ _: {
iagno # go game
hitori # sudoku game
atomix # puzzle game
;
;
};
};

View file

@ -1,13 +1,15 @@
_: {
_:
{
config,
lib,
pkgs,
...
}: {
}:
{
options.local.DE.xfce.enable = lib.mkEnableOption "";
config = lib.mkIf config.local.DE.xfce.enable {
environment.systemPackages = [pkgs.xfce.xfce4-whiskermenu-plugin];
environment.systemPackages = [ pkgs.xfce.xfce4-whiskermenu-plugin ];
services.xserver = {
enable = true;
desktopManager.xfce = {

View file

@ -1,8 +1,6 @@
_: {
config,
lib,
...
}: {
_:
{ config, lib, ... }:
{
options.local.DM = {
autoLogin = lib.mkEnableOption "";
loginUser = lib.mkOption {

View file

@ -1,9 +1,11 @@
{self, ...}: {
{ self, ... }:
{
config,
lib,
pkgs,
...
}: {
}:
{
options.local.DM.lightdm.enable = lib.mkEnableOption "";
config = lib.mkIf config.local.DM.lightdm.enable {

View file

@ -1,11 +1,14 @@
_: {
_:
{
config,
pkgs,
lib,
...
}: let
}:
let
cfg = config.local.X11Programs;
in {
in
{
options.local.X11Programs = {
sxhkd.enable = lib.mkEnableOption "";
};
@ -17,7 +20,7 @@ in {
layout = "us";
libinput.enable = true;
xautolock.enable = false;
excludePackages = [pkgs.xterm];
excludePackages = [ pkgs.xterm ];
desktopManager.xterm.enable = false;
};
}
@ -54,18 +57,17 @@ in {
maim -s | xclip -selection clipboard -t image/png
'';
in
lib.mkIf cfg.sxhkd.enable
{
environment.systemPackages = [
pkgs.maim #screenshooter
pkgs.brightnessctl #brightness control for laptop
pkgs.playerctl #music control
pkgs.xclip
];
services.xserver.displayManager.sessionCommands = ''
${lib.getExe' pkgs.sxhkd "sxhkd"} -c ${configFile} &
'';
}
lib.mkIf cfg.sxhkd.enable {
environment.systemPackages = [
pkgs.maim # screenshooter
pkgs.brightnessctl # brightness control for laptop
pkgs.playerctl # music control
pkgs.xclip
];
services.xserver.displayManager.sessionCommands = ''
${lib.getExe' pkgs.sxhkd "sxhkd"} -c ${configFile} &
'';
}
)
];
_file = ./X11.nix;

View file

@ -1,9 +1,11 @@
{self, ...}: {
{ self, ... }:
{
lib,
pkgs,
config,
...
}: {
}:
{
options.local.bootConfig.disable = lib.mkEnableOption "";
config = lib.mkIf (!config.local.bootConfig.disable) {
environment.etc = {
@ -13,7 +15,7 @@
};
};
boot = {
blacklistedKernelModules = ["pcspkr"];
blacklistedKernelModules = [ "pcspkr" ];
kernelParams = lib.mkAfter [
"acpi_call"
"pti=auto"
@ -76,8 +78,8 @@
Type = "oneshot";
RemainAfterExit = true;
};
path = [pkgs.efibootmgr];
wantedBy = ["default.target"];
path = [ pkgs.efibootmgr ];
wantedBy = [ "default.target" ];
script = ''
efibootmgr -t 0
'';

View file

@ -1,50 +1,50 @@
_: {
config,
lib,
...
}: {
_:
{ config, lib, ... }:
{
options.local.remoteBuild = {
enable = lib.mkEnableOption "";
isBuilder = lib.mkEnableOption "";
};
config = lib.mkMerge [
(
lib.mkIf config.local.remoteBuild.enable {
nix = {
settings = {
keep-outputs = false;
keep-derivations = false;
builders-use-substitutes = true;
max-jobs = 0;
substituters = [
"ssh-ng://nix-ssh@gerg-desktop"
];
trusted-public-keys = [
"gerg-desktop:6p1+h6jQnb1MOt3ra3PlQpfgEEF4zRrQWiEuAqcjBj8="
];
};
distributedBuilds = true;
buildMachines = [
{
hostName = "gerg-desktop";
protocol = "ssh-ng";
maxJobs = 32;
systems = ["x86_64-linux" "i686-linux"];
supportedFeatures = ["big-parallel" "nixos-test" "kvm" "benchmark"];
sshUser = "builder";
sshKey = "/etc/ssh/ssh_host_ed25519_key";
publicHostKey = config.local.keys.gerg-desktop_fingerprint;
}
(lib.mkIf config.local.remoteBuild.enable {
nix = {
settings = {
keep-outputs = false;
keep-derivations = false;
builders-use-substitutes = true;
max-jobs = 0;
substituters = [ "ssh-ng://nix-ssh@gerg-desktop" ];
trusted-public-keys = [
"gerg-desktop:6p1+h6jQnb1MOt3ra3PlQpfgEEF4zRrQWiEuAqcjBj8="
];
};
programs.ssh.knownHosts = {
gerg-desktop = {
extraHostNames = ["gerg-desktop.lan"];
publicKey = config.local.keys.root_gerg-desktop;
};
distributedBuilds = true;
buildMachines = [ {
hostName = "gerg-desktop";
protocol = "ssh-ng";
maxJobs = 32;
systems = [
"x86_64-linux"
"i686-linux"
];
supportedFeatures = [
"big-parallel"
"nixos-test"
"kvm"
"benchmark"
];
sshUser = "builder";
sshKey = "/etc/ssh/ssh_host_ed25519_key";
publicHostKey = config.local.keys.gerg-desktop_fingerprint;
} ];
};
programs.ssh.knownHosts = {
gerg-desktop = {
extraHostNames = [ "gerg-desktop.lan" ];
publicKey = config.local.keys.root_gerg-desktop;
};
}
)
};
})
(
let
@ -53,44 +53,48 @@ _: {
config.local.keys.root_game-laptop
];
in
lib.mkIf config.local.remoteBuild.isBuilder
{
sops.secrets.store_key = {};
users = {
groups.builder = {};
users.builder = {
createHome = false;
isSystemUser = true;
openssh.authorizedKeys = {inherit keys;};
useDefaultShell = true;
group = "builder";
};
};
services.openssh.extraConfig = ''
Match User builder
AllowAgentForwarding no
AllowTcpForwarding no
PermitTTY no
PermitTunnel no
X11Forwarding no
Match All
'';
nix = {
settings = {
trusted-users = ["builder" "nix-ssh"];
keep-outputs = true;
keep-derivations = true;
secret-key-files = config.sops.secrets.store_key.path;
};
sshServe = {
enable = true;
write = true;
lib.mkIf config.local.remoteBuild.isBuilder {
sops.secrets.store_key = { };
users = {
groups.builder = { };
users.builder = {
createHome = false;
isSystemUser = true;
openssh.authorizedKeys = {
inherit keys;
protocol = "ssh-ng";
};
useDefaultShell = true;
group = "builder";
};
}
};
services.openssh.extraConfig = ''
Match User builder
AllowAgentForwarding no
AllowTcpForwarding no
PermitTTY no
PermitTunnel no
X11Forwarding no
Match All
'';
nix = {
settings = {
trusted-users = [
"builder"
"nix-ssh"
];
keep-outputs = true;
keep-derivations = true;
secret-key-files = config.sops.secrets.store_key.path;
};
sshServe = {
enable = true;
write = true;
inherit keys;
protocol = "ssh-ng";
};
};
}
)
];
_file = ./builders.nix;

View file

@ -1,28 +1,25 @@
_: {
config,
lib,
...
}: let
_:
{ config, lib, ... }:
let
cfg = config.local.hardware;
in {
in
{
options.local.hardware = {
gpuAcceleration.disable = lib.mkEnableOption "";
sound.disable = lib.mkEnableOption "";
};
config = lib.mkMerge [
(
lib.mkIf (! cfg.gpuAcceleration.disable) {
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
}
)
(lib.mkIf (! cfg.sound.disable) {
(lib.mkIf (!cfg.gpuAcceleration.disable) {
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
})
(lib.mkIf (!cfg.sound.disable) {
security.rtkit.enable = true;
sound.enable = lib.mkForce false; #disable alsa
hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio
sound.enable = lib.mkForce false; # disable alsa
hardware.pulseaudio.enable = lib.mkForce false; # disable pulseAudio
services.pipewire = {
enable = true;
alsa = {

View file

@ -1,5 +1,7 @@
_: {lib, ...}: {
options.local.keys = lib.mkOption {};
_:
{ lib, ... }:
{
options.local.keys = lib.mkOption { };
config.local.keys = {
gerg_gerg-phone = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDU6BnoHIgMLgZVGuvi03J9l5Z1yP1P5Q8QPyjRHyi77";

View file

@ -1,42 +1,46 @@
_: {
_:
{
lib,
config,
pkgs,
...
}: {
}:
{
options.local.allowedUnfree = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
default = [ ];
};
config = {
nixpkgs = {
#TODO better way of doing this
overlays = [(self: _: {inherit (self.stdenv.hostPlatform) system;})];
overlays = [ (self: _: { inherit (self.stdenv.hostPlatform) system; }) ];
config = {
allowAliases = false;
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
allowUnfreePredicate =
pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
};
};
programs.git.enable = true;
environment.defaultPackages = lib.mkForce (builtins.attrValues {
inherit
(pkgs)
bottom #view tasks
efibootmgr #efi editor
nix-output-monitor #nom nom nom nom;
nix-tree #view packages
pciutils #lspci
environment.defaultPackages = lib.mkForce (
builtins.attrValues {
inherit (pkgs)
bottom # view tasks
efibootmgr # efi editor
nix-output-monitor # nom nom nom nom;
nix-tree # view packages
pciutils # lspci
;
});
}
);
#enable ssh
programs.mtr.enable = true; #ping and traceroute
programs.mtr.enable = true; # ping and traceroute
services.openssh = {
enable = true;
hostKeys = lib.mkForce [];
hostKeys = lib.mkForce [ ];
settings = {
PermitRootLogin = lib.mkDefault "no";
PasswordAuthentication = false;

View file

@ -1,17 +1,17 @@
inputs: {
pkgs,
lib,
...
}:
inputs:
{ pkgs, lib, ... }:
#
# Flake registry and $NIX_PATH pinning
#
let
alias = inputs // {nixpkgs = inputs.unstable;};
alias = inputs // {
nixpkgs = inputs.unstable;
};
flakes = lib.filterAttrs (_: lib.isType "flake") alias;
in {
in
{
nix.nixPath = lib.mapAttrsToList (x: _: "${x}=flake:${x}") flakes;
nix.registry = lib.mapAttrs (_: flake: {inherit flake;}) flakes;
nix.registry = lib.mapAttrs (_: flake: { inherit flake; }) flakes;
#
# Ignore global registry
#
@ -50,15 +50,13 @@ in {
"root"
"@wheel"
];
allowed-users = [];
allowed-users = [ ];
use-xdg-base-directories = true;
auto-allocate-uids = true;
};
#
# Fix for use-xdg-base-directories https://github.com/NixOS/nixpkgs/pull/241518
#
environment.profiles = [
"\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile"
];
environment.profiles = [ "\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile" ];
_file = ./nix.nix;
}

View file

@ -1,30 +1,18 @@
{ fetch-rs, self, ... }:
{
fetch-rs,
self,
...
}: {
pkgs,
config,
lib,
...
}: {
systemd.tmpfiles.rules = [
"d /tmp/neovim-page 0777 root root - -"
];
}:
{
systemd.tmpfiles.rules = [ "d /tmp/neovim-page 0777 root root - -" ];
environment = {
systemPackages = builtins.attrValues {
inherit
(pkgs)
page
eza
fzf
;
inherit
(fetch-rs.packages.${pkgs.system})
fetch-rs
;
inherit (pkgs) page eza fzf;
inherit (fetch-rs.packages.${pkgs.system}) fetch-rs;
};
binsh = lib.getExe pkgs.dash; #use dash for speed
binsh = lib.getExe pkgs.dash; # use dash for speed
variables = {
EDITOR = "nvim";
VISUAL = "nvim";
@ -39,7 +27,8 @@
pastebin = "curl -F 'clbin=<-' https://clbin.com";
termbin = "nc termbin.com 9999";
#nix stuff
gc-check = "nix-store --gc --print-roots | egrep -v \"^(/nix/var|/run/\w+-system|\{memory|/proc)\"";
gc-check = ''
nix-store --gc --print-roots | egrep -v "^(/nix/var|/run/w+-system|{memory|/proc)"'';
#vim stuff
vi = "nvim";
vim = "nvim";
@ -61,14 +50,16 @@
enable = true;
execWheelOnly = true;
extraConfig = ''
Defaults env_keep += "${builtins.concatStringsSep " " (builtins.attrNames config.environment.variables)}"
Defaults env_keep += "${
builtins.concatStringsSep " " (builtins.attrNames config.environment.variables)
}"
Defaults lecture = never
'';
};
#zsh stuff
users.defaultUserShell = pkgs.zsh;
environment.shells = [pkgs.zsh];
environment.shells = [ pkgs.zsh ];
programs = {
zsh = {
enable = true;
@ -122,7 +113,9 @@
enable = true;
settings = {
add_newline = false;
format = "$cmd_duration$git_metrics$git_state$git_branch\n$status$directory$character";
format = ''
$cmd_duration$git_metrics$git_state$git_branch
$status$directory$character'';
right_format = "$sudo$nix_shell\${custom.direnv} $time";
continuation_prompt = " ";
character = {
@ -161,7 +154,9 @@
when = "printenv DIRENV_FILE";
};
time = {
format = "[$time]($style)\n";
format = ''
[$time]($style)
'';
time_format = "%I:%M %p";
disabled = false;
};

View file

@ -1,24 +1,18 @@
{ sops-nix, self, ... }:
{
sops-nix,
self,
...
}: {
pkgs,
config,
lib,
...
}: {
imports = [
sops-nix.nixosModules.sops
];
}:
{
imports = [ sops-nix.nixosModules.sops ];
options.local.sops.disable = lib.mkEnableOption "";
config = lib.mkIf (!config.local.sops.disable) {
environment.systemPackages = [
pkgs.sops
];
environment.systemPackages = [ pkgs.sops ];
sops = {
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
};
_file = ./sops.nix;

View file

@ -1,18 +1,21 @@
_: {
_:
{
config,
lib,
pkgs,
modulesPath,
...
}:
with lib; let
with lib;
let
cfg = config.boot.loader.systemd-boot;
inherit (config.boot.loader) efi;
python3 = pkgs.python3.withPackages (ps: [ps.packaging]);
python3 = pkgs.python3.withPackages (ps: [ ps.packaging ]);
systemdBootBuilder = mountPoint:
systemdBootBuilder =
mountPoint:
pkgs.substituteAll {
src = ./systemd-boot-builder.py;
@ -24,17 +27,14 @@ with lib; let
nix = config.nix.package.out;
timeout = optionalString (config.boot.loader.timeout != null) config.boot.loader.timeout;
timeout =
optionalString (config.boot.loader.timeout != null)
config.boot.loader.timeout;
editor =
if cfg.editor
then "True"
else "False";
editor = if cfg.editor then "True" else "False";
configurationLimit =
if cfg.configurationLimit == null
then 0
else cfg.configurationLimit;
if cfg.configurationLimit == null then 0 else cfg.configurationLimit;
inherit (cfg) consoleMode graceful;
@ -51,46 +51,89 @@ with lib; let
copyExtraFiles = pkgs.writeShellScript "copy-extra-files" ''
empty_file=$(${pkgs.coreutils}/bin/mktemp)
${concatStrings (mapAttrsToList (n: v: ''
${pkgs.coreutils}/bin/install -Dp "${v}" "${mountPoint}/"${escapeShellArg n}
${pkgs.coreutils}/bin/install -D $empty_file "${mountPoint}/efi/nixos/.extra-files/"${escapeShellArg n}
'')
cfg.extraFiles)}
${concatStrings (
mapAttrsToList
(n: v: ''
${pkgs.coreutils}/bin/install -Dp "${v}" "${mountPoint}/"${escapeShellArg n}
${pkgs.coreutils}/bin/install -D $empty_file "${mountPoint}/efi/nixos/.extra-files/"${
escapeShellArg n
}
'')
cfg.extraFiles
)}
${concatStrings (mapAttrsToList (n: v: ''
${pkgs.coreutils}/bin/install -Dp "${pkgs.writeText n v}" "${mountPoint}/loader/entries/"${escapeShellArg n}
${pkgs.coreutils}/bin/install -D $empty_file "${mountPoint}/efi/nixos/.extra-files/loader/entries/"${escapeShellArg n}
'')
cfg.extraEntries)}
${concatStrings (
mapAttrsToList
(n: v: ''
${pkgs.coreutils}/bin/install -Dp "${
pkgs.writeText n v
}" "${mountPoint}/loader/entries/"${escapeShellArg n}
${pkgs.coreutils}/bin/install -D $empty_file "${mountPoint}/efi/nixos/.extra-files/loader/entries/"${
escapeShellArg n
}
'')
cfg.extraEntries
)}
'';
};
checkedSystemdBootBuilder = mountPoint:
pkgs.runCommand "systemd-boot" {
nativeBuildInputs = [pkgs.mypy python3];
} ''
install -m755 ${systemdBootBuilder mountPoint} $out
mypy \
--no-implicit-optional \
--disallow-untyped-calls \
--disallow-untyped-defs \
$out
'';
checkedSystemdBootBuilder =
mountPoint:
pkgs.runCommand "systemd-boot"
{
nativeBuildInputs = [
pkgs.mypy
python3
];
}
''
install -m755 ${systemdBootBuilder mountPoint} $out
mypy \
--no-implicit-optional \
--disallow-untyped-calls \
--disallow-untyped-defs \
$out
'';
finalSystemdBootBuilder = let
installDirs =
if cfg.mirroredBoots != []
then cfg.mirroredBoots
else [efi.efiSysMountPoint];
in
pkgs.writeShellScript "install-systemd-boot.sh"
(lib.concatMapStrings (x: "${checkedSystemdBootBuilder x} \"$@\"\n") installDirs)
+ cfg.extraInstallCommands;
in {
disabledModules = ["${modulesPath}/system/boot/loader/systemd-boot/systemd-boot.nix"];
finalSystemdBootBuilder =
let
installDirs =
if cfg.mirroredBoots != [ ] then
cfg.mirroredBoots
else
[ efi.efiSysMountPoint ]
;
in
pkgs.writeShellScript "install-systemd-boot.sh" (
lib.concatMapStrings
(x: ''
${checkedSystemdBootBuilder x} "$@"
'')
installDirs
)
+ cfg.extraInstallCommands
;
in
{
disabledModules = [
"${modulesPath}/system/boot/loader/systemd-boot/systemd-boot.nix"
];
imports = [
(mkRenamedOptionModule ["boot" "loader" "gummiboot" "enable"] ["boot" "loader" "systemd-boot" "enable"])
(mkRenamedOptionModule
[
"boot"
"loader"
"gummiboot"
"enable"
]
[
"boot"
"loader"
"systemd-boot"
"enable"
]
)
];
options.boot.loader.systemd-boot = {
@ -99,7 +142,9 @@ in {
type = types.bool;
description = lib.mdDoc "Whether to enable the systemd-boot (formerly gummiboot) EFI boot manager";
description =
lib.mdDoc
"Whether to enable the systemd-boot (formerly gummiboot) EFI boot manager";
};
editor = mkOption {
@ -148,7 +193,14 @@ in {
consoleMode = mkOption {
default = "keep";
type = types.enum ["0" "1" "2" "auto" "max" "keep"];
type = types.enum [
"0"
"1"
"2"
"auto"
"max"
"keep"
];
description = lib.mdDoc ''
The resolution of the console. The following values are valid:
@ -210,7 +262,7 @@ in {
extraEntries = mkOption {
type = types.attrsOf types.lines;
default = {};
default = { };
example = literalExpression ''
{ "memtest86.conf" = '''
title MemTest86
@ -231,7 +283,7 @@ in {
extraFiles = mkOption {
type = types.attrsOf types.path;
default = {};
default = { };
example = literalExpression ''
{ "efi/memtest86/memtest86.efi" = "''${pkgs.memtest86-efi}/BOOTX64.efi"; }
'';
@ -260,7 +312,7 @@ in {
mirroredBoots = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
default = [ ];
example = ''
[ "/boot1" "/boot2" ]
'';
@ -272,36 +324,52 @@ in {
config = mkIf cfg.enable {
assertions =
[
{
assertion = (config.boot.kernelPackages.kernel.features or {efiBootStub = true;}) ? efiBootStub;
message = "This kernel does not support the EFI boot stub";
}
]
++ concatMap (filename: [
{
assertion = !(hasInfix "/" filename);
message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries within folders are not supported";
}
{
assertion = hasSuffix ".conf" filename;
message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries must have a .conf file extension";
}
]) (builtins.attrNames cfg.extraEntries)
++ concatMap (filename: [
{
assertion = !(hasPrefix "/" filename);
message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: paths must not begin with a slash";
}
{
assertion = !(hasInfix ".." filename);
message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: paths must not reference the parent directory";
}
{
assertion = !(hasInfix "nixos/.extra-files" (toLower filename));
message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: files cannot be placed in the nixos/.extra-files directory";
}
]) (builtins.attrNames cfg.extraFiles);
[ {
assertion =
(config.boot.kernelPackages.kernel.features or { efiBootStub = true; })
? efiBootStub;
message = "This kernel does not support the EFI boot stub";
} ]
++ concatMap
(filename: [
{
assertion = !(hasInfix "/" filename);
message = "boot.loader.systemd-boot.extraEntries.${
lib.strings.escapeNixIdentifier filename
} is invalid: entries within folders are not supported";
}
{
assertion = hasSuffix ".conf" filename;
message = "boot.loader.systemd-boot.extraEntries.${
lib.strings.escapeNixIdentifier filename
} is invalid: entries must have a .conf file extension";
}
])
(builtins.attrNames cfg.extraEntries)
++
concatMap
(filename: [
{
assertion = !(hasPrefix "/" filename);
message = "boot.loader.systemd-boot.extraFiles.${
lib.strings.escapeNixIdentifier filename
} is invalid: paths must not begin with a slash";
}
{
assertion = !(hasInfix ".." filename);
message = "boot.loader.systemd-boot.extraFiles.${
lib.strings.escapeNixIdentifier filename
} is invalid: paths must not reference the parent directory";
}
{
assertion = !(hasInfix "nixos/.extra-files" (toLower filename));
message = "boot.loader.systemd-boot.extraFiles.${
lib.strings.escapeNixIdentifier filename
} is invalid: files cannot be placed in the nixos/.extra-files directory";
}
])
(builtins.attrNames cfg.extraFiles)
;
boot.loader.grub.enable = mkDefault false;
@ -339,9 +407,7 @@ in {
boot.loader.id = "systemd-boot";
requiredKernelConfig = with config.lib.kernelConfig; [
(isYes "EFI_STUB")
];
requiredKernelConfig = with config.lib.kernelConfig; [ (isYes "EFI_STUB") ];
};
};
}

View file

@ -1,79 +1,80 @@
_: {
_:
{
pkgs,
config,
lib,
...
}: let
}:
let
cfg = config.local.theming;
in {
in
{
options.local.theming = {
enable = lib.mkEnableOption "";
kmscon.enable = lib.mkEnableOption "";
};
config = lib.mkMerge [
(
lib.mkIf cfg.enable {
environment = {
systemPackages = [
pkgs.flat-remix-gtk
pkgs.flat-remix-icon-theme
pkgs.quintom-cursor-theme
];
etc = {
"xdg/gtk-4.0/settings.ini".text = ''
[Settings]
gtk-cursor-theme-name=Quintom_Ink
gtk-cursor-theme-size=16
gtk-font-name = "Overpass 10"
gtk-icon-theme-name=Flat-Remix-Blue-Dark
gtk-theme-name=Flat-Remix-GTK-Blue-Darkest
'';
"xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-cursor-theme-name=Quintom_Ink
gtk-cursor-theme-size=16
gtk-font-name = "Overpass 10"
gtk-icon-theme-name=Flat-Remix-Blue-Dark
gtk-theme-name=Flat-Remix-GTK-Blue-Darkest
'';
"xdg/gtk-2.0/gtkrc".text = ''
gtk-cursor-theme-name = "Quintom_Ink"
gtk-cursor-theme-size = 16
gtk-font-name = "Overpass 10"
gtk-icon-theme-name = "Flat-Remix-Blue-Dark"
gtk-theme-name = "Flat-Remix-GTK-Blue-Darkest"
'';
"xdg/Xresources".text = ''
Xcursor.size: 16
Xcursor.theme: Quintom_Ink
'';
};
(lib.mkIf cfg.enable {
environment = {
systemPackages = [
pkgs.flat-remix-gtk
pkgs.flat-remix-icon-theme
pkgs.quintom-cursor-theme
];
etc = {
"xdg/gtk-4.0/settings.ini".text = ''
[Settings]
gtk-cursor-theme-name=Quintom_Ink
gtk-cursor-theme-size=16
gtk-font-name = "Overpass 10"
gtk-icon-theme-name=Flat-Remix-Blue-Dark
gtk-theme-name=Flat-Remix-GTK-Blue-Darkest
'';
"xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-cursor-theme-name=Quintom_Ink
gtk-cursor-theme-size=16
gtk-font-name = "Overpass 10"
gtk-icon-theme-name=Flat-Remix-Blue-Dark
gtk-theme-name=Flat-Remix-GTK-Blue-Darkest
'';
"xdg/gtk-2.0/gtkrc".text = ''
gtk-cursor-theme-name = "Quintom_Ink"
gtk-cursor-theme-size = 16
gtk-font-name = "Overpass 10"
gtk-icon-theme-name = "Flat-Remix-Blue-Dark"
gtk-theme-name = "Flat-Remix-GTK-Blue-Darkest"
'';
"xdg/Xresources".text = ''
Xcursor.size: 16
Xcursor.theme: Quintom_Ink
'';
};
qt = {
};
qt = {
enable = true;
style = "gtk2";
platformTheme = "gtk2";
};
services.xserver.displayManager.sessionCommands = ''
${lib.getExe' pkgs.xorg.xrdb "xrdb"} -load /etc/xdg/Xresources
'';
fonts = {
packages = [ pkgs.overpass ];
enableDefaultPackages = false;
fontDir.enable = true;
fontconfig = {
enable = true;
style = "gtk2";
platformTheme = "gtk2";
};
services.xserver.displayManager.sessionCommands = ''
${lib.getExe' pkgs.xorg.xrdb "xrdb"} -load /etc/xdg/Xresources
'';
fonts = {
packages = [pkgs.overpass];
enableDefaultPackages = false;
fontDir.enable = true;
fontconfig = {
enable = true;
defaultFonts = {
serif = ["Overpass"];
sansSerif = ["Overpass"];
monospace = ["Overpass Mono"];
};
hinting.enable = true;
antialias = true;
defaultFonts = {
serif = [ "Overpass" ];
sansSerif = [ "Overpass" ];
monospace = [ "Overpass Mono" ];
};
hinting.enable = true;
antialias = true;
};
}
)
};
})
(lib.mkIf cfg.kmscon.enable {
services.kmscon = {
enable = true;
@ -81,16 +82,10 @@ in {
extraConfig = ''
font-size=10
'';
fonts = [
{
name = "OverpassMono";
package =
pkgs.nerdfonts.override
{
fonts = ["Overpass"];
};
}
];
fonts = [ {
name = "OverpassMono";
package = pkgs.nerdfonts.override { fonts = [ "Overpass" ]; };
} ];
};
systemd.services = {
"autovt@tty1".enable = false;