diff options
author | lassulus <lassulus@lassul.us> | 2020-08-06 23:24:29 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-08-06 23:24:29 +0200 |
commit | e0e91cfd74c9ce5d3f9ce9c2e2efab322a00f960 (patch) | |
tree | f17565a1d7bc496b0b439ff45010f3f9c91c6d4f /lib/types.nix | |
parent | 04d9ff2dcdc039518391fcb41ffbb256e2f4ba23 (diff) | |
parent | 42df7da046f46efaca0cb0243a6de3aff599c8aa (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix index 16ccb145e..1eb4d947c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -238,7 +238,7 @@ rec { secret-file = submodule ({ config, ... }: { options = { name = mkOption { - type = filename; + type = pathname; default = config._module.args.name; }; path = mkOption { @@ -256,6 +256,10 @@ rec { type = str; default = "root"; }; + service = mkOption { + type = systemd.unit-name; + default = "secret-${lib.systemd.encodeName config.name}.service"; + }; source-path = mkOption { type = str; default = toString <secrets> + "/${config.name}"; @@ -526,6 +530,14 @@ rec { merge = mergeOneOption; }; + systemd.unit-name = mkOptionType { + name = "systemd unit name"; + check = x: + test "^[0-9A-Za-z:_.\\-]+@?\\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$" x && + stringLength x <= 256; + merge = mergeOneOption; + }; + # RFC952, B. Lexical grammar, <hname> hostname = mkOptionType { name = "hostname"; |