Create flake config for all hosts

This commit is contained in:
Vili Sinervä 2025-06-01 13:34:34 +03:00
parent f9d537522d
commit e3f3b47602
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
2 changed files with 46 additions and 5 deletions

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1748437600,
"narHash": "sha256-hYKMs3ilp09anGO7xzfGs3JqEgUqFMnZ8GMAqI6/k04=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7282cb574e0607e65224d33be8241eae7cfe0979",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -6,11 +6,25 @@
}; };
outputs = outputs =
{ nixpkgs }: { nixpkgs, ... }:
{ {
nixosConfigurations.lithium = nixpkgs.lib.nixosSystem { nixosConfigurations = (
system = "x86_64-linux"; let
modules = [ ./hosts/lithium.nix ]; hosts = map (name: (nixpkgs.lib.removeSuffix ".nix" name)) (
}; builtins.attrNames (builtins.readDir ./hosts)
);
in
builtins.listToAttrs (
map (
host:
nixpkgs.lib.nameValuePair host (
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./hosts/${host}.nix ];
}
)
) hosts
)
);
}; };
} }