factor mkHosts modules into building blocks

This commit is contained in:
Peder Bergebakken Sundt 2024-01-11 01:19:43 +01:00
parent 6528ccbcde
commit dd6e3a903b
1 changed files with 19 additions and 8 deletions

View File

@ -183,16 +183,27 @@
}; };
modules = [ (mkModule hostname domain system inputs stateVersion modules) ]; 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? # TODO: move nixos-hardware imports to the nixos configs?
#attrpath "hostname" "domain" "system" inputs "state" [ modules ... ] #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 ]; 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" [ common-pc common-pc-ssd common-cpu-amd ]; 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" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ]; 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" [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]; 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" [ common-pc common-pc-ssd common-cpu-intel ]; 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" [ common-pc common-pc-ssd common-cpu-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" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-nvidia-nonprime ]; garp = mk "garp" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel-novga cuda ];
#gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad #gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad
#bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist #bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist
}; };