diff --git a/lib/types.nix b/lib/types.nix index 5e9a28ac4f0..0ec94cc5c5e 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -247,6 +247,13 @@ rec { merge = mergeEqualOption; }; + runtimePath = mkOptionType { + name = "runtime path"; + # Hacky: there is no ‘isPath’ primop. + check = x: builtins.substring 0 1 (toString x) == "/"; + merge = log: defs: mergeEqualOption log (map (attrs: attrs // { value = toString attrs.value; }) defs); + }; + # drop this in the future: list = builtins.trace "`types.list` is deprecated; use `types.listOf` instead" types.listOf;