Create flake config for all hosts
This commit is contained in:
parent
f9d537522d
commit
e3f3b47602
2 changed files with 46 additions and 5 deletions
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal 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
|
||||
}
|
24
flake.nix
24
flake.nix
|
@ -6,11 +6,25 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs }:
|
||||
{ nixpkgs, ... }:
|
||||
{
|
||||
nixosConfigurations.lithium = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./hosts/lithium.nix ];
|
||||
};
|
||||
nixosConfigurations = (
|
||||
let
|
||||
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
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue