Make hostName and secretPath configurable through NIX_PATH.
This commit is contained in:
parent
29c876ce83
commit
21b2170e67
2 changed files with 4 additions and 2 deletions
|
@ -3,7 +3,9 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
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";
|
machineConf = machinePath + "/configuration.nix";
|
||||||
machineOpts = machinePath + "/options.nix";
|
machineOpts = machinePath + "/options.nix";
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -36,7 +36,7 @@ with lib;
|
||||||
};
|
};
|
||||||
secretPath = mkOption {
|
secretPath = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "/secret";
|
default = (findFirst (elem: elem.prefix == "secretPath") { path = "/secret"; } builtins.nixPath).path;
|
||||||
description = ''
|
description = ''
|
||||||
Path to you systems secret folder containing files with sensitive information.
|
Path to you systems secret folder containing files with sensitive information.
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue