From dd6e3a903b368365a95fa156586609755c9c7ba3 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 11 Jan 2024 01:19:43 +0100 Subject: [PATCH] factor mkHosts modules into building blocks --- flake.nix | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index f3154df..7e7e25f 100644 --- a/flake.nix +++ b/flake.nix @@ -183,16 +183,27 @@ }; modules = [ (mkModule hostname domain system inputs stateVersion modules) ]; }; - mkHosts = mk: with nixos-hardware.nixosModules; { + mkHosts = mk: let + ls = imports: { inherit imports; }; + hw = nixos-hardware.nixosModules; + amd = ls [ hw.common-pc hw.common-pc-ssd hw.common-cpu-amd ]; + intel = ls [ hw.common-pc hw.common-pc-ssd hw.common-cpu-intel ]; + intel-novga = ls [ hw.common-pc hw.common-pc-ssd hw.common-cpu-intel-cpu-only ]; + sandy = hw.common-cpu-intel-sandy-bridge; + cuda = hw.common-gpu-nvidia-nonprime; + cuda-prime = hw.common-gpu-nvidia; + rocm = hw.common-gpu-amd; + hidpi = hw.common-hidpi; + in { # TODO: move nixos-hardware imports to the nixos configs? #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 ]; + noximilien = mk "noximilien" "pbsds.net" "x86_64-linux" inputs-2311 "22.11" [ intel ]; + brumlebasse = mk "brumlebasse" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ amd ]; + nord = mk "nord" "pbsds.net" "x86_64-linux" inputs-2305 "22.11" [ intel-novga sandy rocm hidpi ]; + sopp = mk "sopp" "pbsds.net" "x86_64-linux" inputs-2305 "23.05" [ intel cuda ]; + bolle = mk "bolle" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel ]; + eple = mk "eple" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel ]; + garp = mk "garp" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel-novga cuda ]; #gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad #bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist };