diff options
Diffstat (limited to 'system-profiles')
| -rw-r--r-- | system-profiles/bcachefs.nix | 12 | ||||
| -rw-r--r-- | system-profiles/core/default.nix | 34 | ||||
| -rw-r--r-- | system-profiles/default-locale.nix | 27 | ||||
| -rw-r--r-- | system-profiles/initrd-all-crypto-modules.nix | 2 | ||||
| -rw-r--r-- | system-profiles/lanzaboote.nix | 14 | ||||
| -rw-r--r-- | system-profiles/nfsroot.nix | 6 | ||||
| -rw-r--r-- | system-profiles/rebuild-machines/default.nix | 20 | ||||
| -rw-r--r-- | system-profiles/zfs.nix | 6 |
8 files changed, 63 insertions, 58 deletions
diff --git a/system-profiles/bcachefs.nix b/system-profiles/bcachefs.nix index f9f048b9..be12bf20 100644 --- a/system-profiles/bcachefs.nix +++ b/system-profiles/bcachefs.nix | |||
| @@ -1,6 +1,16 @@ | |||
| 1 | { pkgs, ... } : { | 1 | { pkgs, lib, ... } : { |
| 2 | config = { | 2 | config = { |
| 3 | boot.supportedFilesystems.bcachefs = true; | 3 | boot.supportedFilesystems.bcachefs = true; |
| 4 | environment.systemPackages = with pkgs; [ bcachefs-tools ]; | 4 | environment.systemPackages = with pkgs; [ bcachefs-tools ]; |
| 5 | |||
| 6 | boot.kernelPatches = [ | ||
| 7 | { | ||
| 8 | name = "bcachefs-casefold-fix"; | ||
| 9 | patch = null; | ||
| 10 | structuredExtraConfig = with lib.kernel; { | ||
| 11 | UNICODE = lib.mkOverride 90 no; | ||
| 12 | }; | ||
| 13 | } | ||
| 14 | ]; | ||
| 5 | }; | 15 | }; |
| 6 | } | 16 | } |
diff --git a/system-profiles/core/default.nix b/system-profiles/core/default.nix index b85aea4e..e5f9dc16 100644 --- a/system-profiles/core/default.nix +++ b/system-profiles/core/default.nix | |||
| @@ -127,36 +127,16 @@ in { | |||
| 127 | 127 | ||
| 128 | flake-registry = "${flakeInputs.flake-registry}/flake-registry.json"; | 128 | flake-registry = "${flakeInputs.flake-registry}/flake-registry.json"; |
| 129 | }; | 129 | }; |
| 130 | nixPath = [ | 130 | nixPath = map (flake: "${flake}=flake:${flake}") (attrNames config.nix.registry); |
| 131 | "nixpkgs=${pkgs.runCommand "nixpkgs" {} '' | ||
| 132 | mkdir $out | ||
| 133 | ln -s ${./nixpkgs.nix} $out/default.nix | ||
| 134 | ln -s /run/nixpkgs/lib $out/lib | ||
| 135 | ''}" | ||
| 136 | ]; | ||
| 137 | registry = | 131 | registry = |
| 138 | let override = { self = "nixos"; }; | 132 | let override = { self = "nixos"; }; |
| 139 | in mapAttrs' (inpName: inpFlake: nameValuePair | 133 | in mapAttrs' (inpName: inpFlake: nameValuePair |
| 140 | (override.${inpName} or inpName) | 134 | (override.${inpName} or inpName) |
| 141 | { flake = inpFlake; } ) flakeInputs; | 135 | { to = { type = "path"; path = inpFlake; }; } ) flakeInputs; |
| 142 | }; | 136 | }; |
| 143 | 137 | ||
| 144 | systemd.tmpfiles.rules = [ | 138 | systemd.tmpfiles.rules = [ |
| 145 | "L+ /run/nixpkgs - - - - ${flakeInputs.${config.nixpkgs.flakeInput}.outPath}" | 139 | "L+ /run/nixpkgs - - - - ${flakeInputs.${config.nixpkgs.flakeInput}.outPath}" |
| 146 | "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" '' | ||
| 147 | with builtins; | ||
| 148 | |||
| 149 | attrValues (import | ||
| 150 | ( | ||
| 151 | let lock = fromJSON (readFile ${flake + "/flake.lock"}); in | ||
| 152 | fetchTarball { | ||
| 153 | url = "https://github.com/edolstra/flake-compat/archive/''${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
| 154 | sha256 = lock.nodes.flake-compat.locked.narHash; | ||
| 155 | } | ||
| 156 | ) | ||
| 157 | { src = ${flake}; } | ||
| 158 | ).defaultNix.overlays | ||
| 159 | ''}" | ||
| 160 | "L+ /etc/nixos - - - - ${flake}" | 140 | "L+ /etc/nixos - - - - ${flake}" |
| 161 | ] ++ map (input: "L+ /run/flake-inputs/${input} - - - - ${flakeInputs.${input}.outPath}") (attrNames flakeInputs); | 141 | ] ++ map (input: "L+ /run/flake-inputs/${input} - - - - ${flakeInputs.${input}.outPath}") (attrNames flakeInputs); |
| 162 | 142 | ||
| @@ -177,8 +157,6 @@ in { | |||
| 177 | { | 157 | { |
| 178 | manual.manpages.enable = true; | 158 | manual.manpages.enable = true; |
| 179 | systemd.user.startServices = "sd-switch"; | 159 | systemd.user.startServices = "sd-switch"; |
| 180 | |||
| 181 | programs.ssh.internallyManaged = mkForce true; | ||
| 182 | } | 160 | } |
| 183 | ]; | 161 | ]; |
| 184 | extraSpecialArgs = { inherit flake flakeInputs path; hostConfig = config; }; | 162 | extraSpecialArgs = { inherit flake flakeInputs path; hostConfig = config; }; |
| @@ -202,13 +180,7 @@ in { | |||
| 202 | }; | 180 | }; |
| 203 | environment.systemPackages = with pkgs; [ git-annex scutiger ]; | 181 | environment.systemPackages = with pkgs; [ git-annex scutiger ]; |
| 204 | } | 182 | } |
| 205 | ] ++ (optional (options ? system.switch.enableNg) { | 183 | ] ++ (optional (options ? system.rebuild.enableNg) { |
| 206 | system.switch = lib.mkDefault { | ||
| 207 | enable = false; | ||
| 208 | enableNg = true; | ||
| 209 | }; | ||
| 210 | }) | ||
| 211 | ++ (optional (options ? system.rebuild.enableNg) { | ||
| 212 | system.rebuild.enableNg = lib.mkDefault true; | 184 | system.rebuild.enableNg = lib.mkDefault true; |
| 213 | }) | 185 | }) |
| 214 | ++ (optional (options ? services.userborn) { | 186 | ++ (optional (options ? services.userborn) { |
diff --git a/system-profiles/default-locale.nix b/system-profiles/default-locale.nix index 2d483f04..60d338cb 100644 --- a/system-profiles/default-locale.nix +++ b/system-profiles/default-locale.nix | |||
| @@ -1,16 +1,23 @@ | |||
| 1 | { lib, ... }: | 1 | { lib, options, ... }: |
| 2 | 2 | ||
| 3 | with lib; | 3 | with lib; |
| 4 | 4 | ||
| 5 | { | 5 | { |
| 6 | i18n = { | 6 | config = foldr recursiveUpdate {} ([ |
| 7 | defaultLocale = "en_DK.UTF-8"; | 7 | { |
| 8 | extraLocaleSettings = { | 8 | i18n = { |
| 9 | "TIME_STYLE" = "long-iso"; | 9 | defaultLocale = "en_DK.UTF-8"; |
| 10 | }; | 10 | extraLocaleSettings = { |
| 11 | supportedLocales = [ "C.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "en_DK.UTF-8/UTF-8" ]; | 11 | "TIME_STYLE" = "long-iso"; |
| 12 | }; | 12 | }; |
| 13 | console.keyMap = mkDefault "dvorak-programmer"; | 13 | }; |
| 14 | console.keyMap = mkDefault "dvorak-programmer"; | ||
| 14 | 15 | ||
| 15 | time.timeZone = mkDefault "Europe/Berlin"; | 16 | time.timeZone = mkDefault "Europe/Berlin"; |
| 17 | } | ||
| 18 | ] ++ (optional (options ? i18n.extraLocales) { | ||
| 19 | i18n.extraLocales = [ "C.UTF-8" "en_US.UTF-8" "en_DK.UTF-8" ]; | ||
| 20 | }) ++ (optional (!(options ? i18n.extraLocales)) { | ||
| 21 | i18n.supportedLocales = [ "C.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "en_DK.UTF-8/UTF-8" ]; | ||
| 22 | })); | ||
| 16 | } | 23 | } |
diff --git a/system-profiles/initrd-all-crypto-modules.nix b/system-profiles/initrd-all-crypto-modules.nix index 45cd4b74..da6c781e 100644 --- a/system-profiles/initrd-all-crypto-modules.nix +++ b/system-profiles/initrd-all-crypto-modules.nix | |||
| @@ -18,7 +18,7 @@ in { | |||
| 18 | { | 18 | { |
| 19 | name = "encrypted_key"; | 19 | name = "encrypted_key"; |
| 20 | patch = null; | 20 | patch = null; |
| 21 | extraStructuredConfig.ENCRYPTED_KEYS = lib.kernel.yes; | 21 | structuredExtraConfig.ENCRYPTED_KEYS = lib.kernel.yes; |
| 22 | } | 22 | } |
| 23 | ]; | 23 | ]; |
| 24 | } | 24 | } |
diff --git a/system-profiles/lanzaboote.nix b/system-profiles/lanzaboote.nix new file mode 100644 index 00000000..f1e179cf --- /dev/null +++ b/system-profiles/lanzaboote.nix | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | { flakeInputs, pkgs, ... }: | ||
| 2 | { | ||
| 3 | imports = [ | ||
| 4 | flakeInputs.lanzaboote.nixosModules.lanzaboote | ||
| 5 | ]; | ||
| 6 | |||
| 7 | config = { | ||
| 8 | environment.systemPackages = [ pkgs.sbctl ]; | ||
| 9 | boot.lanzaboote = { | ||
| 10 | enable = true; | ||
| 11 | pkiBundle = "/var/lib/sbctl"; | ||
| 12 | }; | ||
| 13 | }; | ||
| 14 | } | ||
diff --git a/system-profiles/nfsroot.nix b/system-profiles/nfsroot.nix index 1cd930d9..e3dc2d2e 100644 --- a/system-profiles/nfsroot.nix +++ b/system-profiles/nfsroot.nix | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | { config, options, pkgs, lib, flake, flakeInputs, ... }: | 1 | { config, options, pkgs, lib, flake, ... }: |
| 2 | 2 | ||
| 3 | with lib; | 3 | with lib; |
| 4 | 4 | ||
| @@ -48,7 +48,7 @@ in { | |||
| 48 | fileSystems."/nix/.ro-store" = mkImageMediaOverride | 48 | fileSystems."/nix/.ro-store" = mkImageMediaOverride |
| 49 | { fsType = "nfs4"; | 49 | { fsType = "nfs4"; |
| 50 | device = cfg.storeDevice; | 50 | device = cfg.storeDevice; |
| 51 | options = [ "ro" ]; | 51 | options = [ "ro" "nfsvers=4.2" ]; |
| 52 | neededForBoot = true; | 52 | neededForBoot = true; |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| @@ -86,7 +86,7 @@ in { | |||
| 86 | mkdir -p /mnt-root/etc/ | 86 | mkdir -p /mnt-root/etc/ |
| 87 | cp /etc/resolv.conf /mnt-root/etc/resolv.conf | 87 | cp /etc/resolv.conf /mnt-root/etc/resolv.conf |
| 88 | ''; | 88 | ''; |
| 89 | networking.useDHCP = true; | 89 | networking.useDHCP = mkImageMediaOverride true; |
| 90 | networking.resolvconf.enable = false; | 90 | networking.resolvconf.enable = false; |
| 91 | networking.dhcpcd.persistent = true; | 91 | networking.dhcpcd.persistent = true; |
| 92 | 92 | ||
diff --git a/system-profiles/rebuild-machines/default.nix b/system-profiles/rebuild-machines/default.nix index 544f47e1..de86cd74 100644 --- a/system-profiles/rebuild-machines/default.nix +++ b/system-profiles/rebuild-machines/default.nix | |||
| @@ -25,16 +25,18 @@ let | |||
| 25 | 25 | ||
| 26 | phases = [ "buildPhase" "installPhase" ]; | 26 | phases = [ "buildPhase" "installPhase" ]; |
| 27 | 27 | ||
| 28 | inherit (pkgs) zsh coreutils openssh; | ||
| 29 | inherit (cfg) scriptName; | ||
| 30 | inherit (cfg.flake) flakeOutput; | ||
| 31 | flake = cfg.flake.name; | ||
| 32 | nixosRebuild = config.system.build.nixos-rebuild; | ||
| 33 | inherit (config.security) wrapperDir; | ||
| 34 | inherit sshConfig; | ||
| 35 | |||
| 36 | buildPhase = '' | 28 | buildPhase = '' |
| 37 | substituteAll $src rebuild-machine.zsh | 29 | substitute $src rebuild-machine.zsh \ |
| 30 | --subst-var-by zsh ${pkgs.zsh} \ | ||
| 31 | --subst-var-by coreutils ${pkgs.coreutils} \ | ||
| 32 | --subst-var-by openssh ${pkgs.openssh} \ | ||
| 33 | --subst-var-by wrapperDir ${config.security.wrapperDir} \ | ||
| 34 | --subst-var-by sshConfig ${sshConfig} \ | ||
| 35 | --subst-var-by out "$out" \ | ||
| 36 | --subst-var-by nixosRebuild ${config.system.build.nixos-rebuild} \ | ||
| 37 | --subst-var-by flake ${cfg.flake.name} \ | ||
| 38 | --subst-var-by scriptName ${cfg.scriptName} \ | ||
| 39 | --subst-var-by flakeOutput ${cfg.flake.flakeOutput} | ||
| 38 | ''; | 40 | ''; |
| 39 | 41 | ||
| 40 | installPhase = '' | 42 | installPhase = '' |
diff --git a/system-profiles/zfs.nix b/system-profiles/zfs.nix index 149decee..af9f1c17 100644 --- a/system-profiles/zfs.nix +++ b/system-profiles/zfs.nix | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | { pkgs, lib, ... } : { | 1 | { config, pkgs, lib, ... } : { |
| 2 | config = { | 2 | config = { |
| 3 | boot = { | 3 | boot = { |
| 4 | kernelPackages = pkgs.linuxPackages_6_11; | 4 | kernelPackages = pkgs.linuxPackages_6_12; |
| 5 | zfs.package = pkgs.zfs_unstable; | 5 | zfs.package = pkgs.zfs_2_3; |
| 6 | 6 | ||
| 7 | supportedFilesystems.zfs = true; | 7 | supportedFilesystems.zfs = true; |
| 8 | }; | 8 | }; |
