mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Refactor host entrypoints
This commit is contained in:
parent
a450e6119a
commit
13ea22656c
1 changed files with 19 additions and 21 deletions
|
|
@ -1,25 +1,23 @@
|
||||||
{
|
{ inputs, self, ... }:
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
subdirsOf =
|
specialArgs = {
|
||||||
dir: builtins.attrNames (lib.filterAttrs (_: v: v == "directory") (builtins.readDir dir));
|
inherit inputs self;
|
||||||
|
};
|
||||||
|
modulesOf = hostname: [
|
||||||
|
{ networking.hostName = hostname; }
|
||||||
|
"${self}/hosts/${hostname}"
|
||||||
|
"${self}/users/seb/@${hostname}"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.nixosConfigurations = lib.genAttrs (subdirsOf "${self}/hosts") (
|
flake.nixosConfigurations = {
|
||||||
name:
|
north = inputs.nixpkgs.lib.nixosSystem {
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inherit specialArgs;
|
||||||
specialArgs = {
|
modules = modulesOf "north";
|
||||||
inherit inputs self;
|
};
|
||||||
};
|
inspiron = inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
inherit specialArgs;
|
||||||
{ networking.hostName = name; }
|
modules = modulesOf "inspiron";
|
||||||
"${self}/hosts/${name}"
|
};
|
||||||
"${self}/users/seb/@${name}"
|
};
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue