use roles attribute to import config for host

This commit is contained in:
Tyler Starr 2024-12-21 14:45:52 -08:00
parent cff0d07665
commit 85d52e311f
2 changed files with 7 additions and 1 deletions

View File

@ -19,7 +19,7 @@
lib = nixpkgs.lib;
in {
nixosConfigurations = lib.mapAttrs (hostname: hostConfig:
lib.nixosSystem (import ./hosts/${hostname} {
lib.nixosSystem (import ./hosts/${hostConfig.role} {
inherit lib;
inherit system inputs agenix home-manager jovian-nixos nixos-wsl;
specialArgs = {

View File

@ -1,20 +1,26 @@
{
"kestrel": {
"role": "kestrel",
"user": "tstarr"
},
"shivan": {
"role": "shivan",
"user": "tstarr"
},
"torus": {
"role": "torus",
"user": "tstarr"
},
"bulwark": {
"role": "bulwark",
"user": "tstarr"
},
"osprey": {
"role": "osprey",
"user": "tstarr"
},
"wsl": {
"role": "wsl",
"user": "user"
}
}