|
|
|
@ -1,10 +1,16 @@ |
|
|
|
|
{ lib, ... }: |
|
|
|
|
|
|
|
|
|
with builtins; |
|
|
|
|
with lib; |
|
|
|
|
|
|
|
|
|
let |
|
|
|
|
fn = import ./fn.nix { inherit lib; }; |
|
|
|
|
# hostName can be set with -I hostName=$HOSTNAME, defaults to the contents of /secret/hostName |
|
|
|
|
hostName = (findFirst (elem: elem.prefix == "hostName") { path = (fileContents /secret/hostName); } builtins.nixPath).path; |
|
|
|
|
hostName = let |
|
|
|
|
hostVal = (tryEval <hostName>).value; |
|
|
|
|
in fn.ifelse (hostVal != false) |
|
|
|
|
hostVal |
|
|
|
|
(fileContents /secret/hostName); |
|
|
|
|
machinePath = (builtins.toPath ( ./machines + ("/" + hostName))); |
|
|
|
|
machineConf = machinePath + "/configuration.nix"; |
|
|
|
|
machineOpts = machinePath + "/options.nix"; |
|
|
|
|