Make hostName and secretPath configurable through NIX_PATH.

This commit is contained in:
Kevin Baensch 2019-09-07 05:22:25 +02:00
parent 29c876ce83
commit 21b2170e67
2 changed files with 4 additions and 2 deletions

View file

@ -3,7 +3,9 @@
with lib;
let
machinePath = (builtins.toPath ( ./machines + ("/" + (fileContents /secret/hostName))));
# 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;
machinePath = (builtins.toPath ( ./machines + ("/" + hostName)));
machineConf = machinePath + "/configuration.nix";
machineOpts = machinePath + "/options.nix";
in {

View file

@ -36,7 +36,7 @@ with lib;
};
secretPath = mkOption {
type = types.str;
default = "/secret";
default = (findFirst (elem: elem.prefix == "secretPath") { path = "/secret"; } builtins.nixPath).path;
description = ''
Path to you systems secret folder containing files with sensitive information.
'';