Fix import and make pkgFilter recurse into dependencies.
This commit is contained in:
parent
1476ff6acb
commit
af66caf14a
2 changed files with 32 additions and 15 deletions
|
@ -4,19 +4,20 @@ with builtins;
|
|||
with lib;
|
||||
|
||||
let
|
||||
fn = import ./fn.nix { inherit lib; };
|
||||
fn = import (toString ./fn.nix) { inherit lib; };
|
||||
# Cannot use <hostName> here as those evaluations only work with existing paths >.<
|
||||
# hostName and secretPtah can be set with -I hostName=$HOSTNAME and -I secretPath=$SECRETPATH respectively
|
||||
# , defaults to the contents of /secret/hostName
|
||||
secretPath = fn.ifelse ((tryEval <secretPath>).value != false)
|
||||
<secretPath>
|
||||
/secret;
|
||||
hostName = (findFirst
|
||||
(elem: elem.prefix == "hostName")
|
||||
{ path = (fileContents "${secretPath}/hostName"); }
|
||||
nixPath
|
||||
secretPath = fn.ifelse ((tryEval (toString <secretPath>)).value != false)
|
||||
(toString <secretPath>)
|
||||
(toString /secret);
|
||||
hostName = (
|
||||
findFirst
|
||||
(elem: elem.prefix == "hostName")
|
||||
{ path = (fileContents "${secretPath}/hostName"); }
|
||||
nixPath
|
||||
).path;
|
||||
machinePath = (builtins.toPath ( ./machines + ("/" + hostName)));
|
||||
machinePath = (builtins.toPath (./machines + ("/" + hostName)));
|
||||
machineFiles = fn.lst { p = machinePath; b = true; };
|
||||
configFiles = fn.lst { p = (toString ./config); b = true; };
|
||||
pkgsFiles = fn.lst { p = (toString ./pkgs); b = true; };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue