attempt 1
This commit is contained in:
parent
cb8cb2d9b3
commit
dc21222846
1 changed files with 23 additions and 10 deletions
|
@ -5,6 +5,9 @@
|
||||||
inherit (inputs) self;
|
inherit (inputs) self;
|
||||||
inherit (self) lib;
|
inherit (self) lib;
|
||||||
|
|
||||||
|
inherit (lib.attrsets) listToAttrs;
|
||||||
|
inherit (lib.path) append;
|
||||||
|
|
||||||
createHost' = extraModules: hostDir: lib.nixosSystem {
|
createHost' = extraModules: hostDir: lib.nixosSystem {
|
||||||
system = null;
|
system = null;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
@ -17,16 +20,26 @@
|
||||||
] ++ extraModules;
|
] ++ extraModules;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
createHost = createHost' [];
|
||||||
createDesktop = createHost' [ ./common/desktop ];
|
createDesktop = createHost' [ ./common/desktop ];
|
||||||
createServer = createHost' [];
|
createServer = createHost' [];
|
||||||
in {
|
|
||||||
niks = createDesktop ./niks;
|
|
||||||
|
|
||||||
del = createDesktop ./del;
|
createHosts = hosts: listToAttrs (map (host: let
|
||||||
|
createFn = {
|
||||||
hape = createDesktop ./hape;
|
desktop = createDesktop;
|
||||||
|
server = createServer;
|
||||||
chmura = createServer ./chmura;
|
generic = createHost;
|
||||||
|
}."${host.type}";
|
||||||
${inputs.work-secrets.hostname} = createDesktop ./work;
|
path' = append host.dir "system.nix";
|
||||||
}
|
cfg = import path';
|
||||||
|
in {
|
||||||
|
name = cfg.poz.other.system.hostname;
|
||||||
|
value = createFn host.dir;
|
||||||
|
}) hosts);
|
||||||
|
in createHosts [
|
||||||
|
{ dir = ./niks; type = "desktop"; }
|
||||||
|
{ dir = ./del; type = "desktop"; }
|
||||||
|
{ dir = ./hape; type = "desktop"; }
|
||||||
|
{ dir = ./chmura; type = "server"; }
|
||||||
|
{ dir = ./work; type = "desktop"; }
|
||||||
|
]
|
||||||
|
|
Loading…
Reference in a new issue