forked from clan/clan-core
buildClan: fix importing machines from settings
This commit is contained in:
parent
618fb4b8a7
commit
d51dd39ae3
@ -4,15 +4,12 @@
|
|||||||
, machines ? { } # allows to include machine-specific modules i.e. machines.${name} = { ... }
|
, machines ? { } # allows to include machine-specific modules i.e. machines.${name} = { ... }
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
machinesDirs =
|
machinesDirs = lib.optionalAttrs (builtins.pathExists "${directory}/machines") (builtins.readDir (directory + /machines));
|
||||||
if builtins.pathExists "${directory}/machines"
|
|
||||||
then builtins.readDir directory + /machines
|
|
||||||
else { };
|
|
||||||
|
|
||||||
machineSettings = machineName:
|
machineSettings = machineName:
|
||||||
if builtins.pathExists "${directory}/machines/${machineName}/settings.json"
|
lib.optionalAttrs (builtins.pathExists "${directory}/machines/${machineName}/settings.json")
|
||||||
then builtins.fromJSON (builtins.readFile directory + /machines/${machineName}/settings.json)
|
builtins.fromJSON
|
||||||
else { };
|
(builtins.readFile (directory + /machines/${machineName}/settings.json));
|
||||||
|
|
||||||
nixosConfigurations = lib.mapAttrs
|
nixosConfigurations = lib.mapAttrs
|
||||||
(name: _:
|
(name: _:
|
||||||
|
Loading…
Reference in New Issue
Block a user