diff --git a/flake.nix b/flake.nix index e5ff404..f3154df 100644 --- a/flake.nix +++ b/flake.nix @@ -121,14 +121,9 @@ #"riscv64-linux" ]; - mkModule = hostname: domain: system: inputs: modules: ({ lib, ... }: { - #TODO: fix infinite recursion: - /** / - _module.args = lib.mkFinal { - inherit inputs; - flakes = mkFlakeView inputs system; - }; - /**/ + mkModule = hostname: domain: system: inputs: stateVersion: modules: ({ lib, ... }: { + system.stateVersion = lib.mkDefault stateVersion; # TODO: home-manager + imports = [ ./base.nix "${self}/hosts/${hostname}" @@ -137,13 +132,11 @@ ] ++ modules; #++ inputs.flake-programs-sqlite.nixosModules.programs-sqlite; # TODO: make work - sops = { - defaultSopsFile = lib.mkIf (builtins.pathExists ./secrets/${hostname}.yaml) + sops.defaultSopsFile = lib.mkIf (builtins.pathExists ./secrets/${hostname}.yaml) ./secrets/${hostname}.yaml; - age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - age.keyFile = "/var/lib/sops-nix/key.txt"; - age.generateKey = true; - }; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + sops.age.keyFile = "/var/lib/sops-nix/key.txt"; + sops.age.generateKey = true; home-manager.useGlobalPkgs = true; # go brrr, reuse overrides home-manager.extraSpecialArgs = { @@ -169,7 +162,7 @@ nix.registry.nixpkgs.flake = inputs.nixpkgs; nix.registry.nixpkgs-unstable.flake = inputs.unstable; nix.registry.nixpkgs-git = { - from.id = "nixpkgs"; + from.id = "nixpkgs-git"; from.type = "indirect"; to.type = "github"; to.owner = "NixOS"; @@ -182,24 +175,24 @@ "nixpkgs-git=github:NixOS/nixpkgs/nixos-unstable-small" ]; }); - mkConfig = hostname: domain: system: inputs: modules: inputs.nixpkgs.lib.nixosSystem { + mkConfig = hostname: domain: system: inputs: stateVersion: modules: inputs.nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs; flakes = mkFlakeView inputs system; }; - modules = [ (mkModule hostname domain system inputs modules) ]; + modules = [ (mkModule hostname domain system inputs stateVersion modules) ]; }; mkHosts = mk: with nixos-hardware.nixosModules; { # TODO: move nixos-hardware imports to the nixos configs? - #attrpath "hostname" "domain" "system" inputs [ modules ... ] - noximilien = mk "noximilien" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-intel ]; - brumlebasse = mk "brumlebasse" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-amd ]; - nord = mk "nord" "pbsds.net" "x86_64-linux" inputs-2305 [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ]; - sopp = mk "sopp" "pbsds.net" "x86_64-linux" inputs-2305 [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]; - bolle = mk "bolle" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-intel ]; - eple = mk "eple" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-intel ]; - garp = mk "garp" "pbsds.net" "x86_64-linux" inputs-2305 [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-nvidia-nonprime ]; + #attrpath "hostname" "domain" "system" inputs "state" [ modules ... ] + noximilien = mk "noximilien" "pbsds.net" "x86_64-linux" inputs-2311 "22.11" [ common-pc common-pc-ssd common-cpu-intel ]; + brumlebasse = mk "brumlebasse" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-amd ]; + nord = mk "nord" "pbsds.net" "x86_64-linux" inputs-2305 "22.11" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ]; + sopp = mk "sopp" "pbsds.net" "x86_64-linux" inputs-2305 "23.05" [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]; + bolle = mk "bolle" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-intel ]; + eple = mk "eple" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-intel ]; + garp = mk "garp" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-nvidia-nonprime ]; #gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad #bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist }; @@ -215,7 +208,7 @@ flakes-2305 = mkFlakeView inputs-2305 system; }); - nixosModules = mkHosts mkModule; + nixosModules = mkHosts mkModule; nixosConfigurations = mkHosts mkConfig; packages = forAllSystems ({ inputs, pkgs, flakes, ... }: { diff --git a/hosts/bolle/default.nix b/hosts/bolle/default.nix index 3055d60..fb4ff53 100644 --- a/hosts/bolle/default.nix +++ b/hosts/bolle/default.nix @@ -55,12 +55,4 @@ # TODO: remove? Move? programs.dconf.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/brumlebasse/default.nix b/hosts/brumlebasse/default.nix index 20b14e6..a715dc0 100644 --- a/hosts/brumlebasse/default.nix +++ b/hosts/brumlebasse/default.nix @@ -49,12 +49,4 @@ # TODO: remove? Move? programs.dconf.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? } diff --git a/hosts/eple/default.nix b/hosts/eple/default.nix index 11b628e..91ee71f 100644 --- a/hosts/eple/default.nix +++ b/hosts/eple/default.nix @@ -50,12 +50,4 @@ # TODO: remove? Move? programs.dconf.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/garp/default.nix b/hosts/garp/default.nix index 0e17d1c..d81465b 100644 --- a/hosts/garp/default.nix +++ b/hosts/garp/default.nix @@ -62,12 +62,4 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? } diff --git a/hosts/nord/default.nix b/hosts/nord/default.nix index 9fdb665..02c2b9b 100644 --- a/hosts/nord/default.nix +++ b/hosts/nord/default.nix @@ -75,12 +75,4 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? } diff --git a/hosts/noximilien/default.nix b/hosts/noximilien/default.nix index 9b5d7c0..7b1a858 100644 --- a/hosts/noximilien/default.nix +++ b/hosts/noximilien/default.nix @@ -132,12 +132,4 @@ # TODO: remove? Move? programs.dconf.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? }