diff --git a/custom/modules/secrets-store.nix b/custom/modules/secrets-store.nix index 0081573..f94adf9 100644 --- a/custom/modules/secrets-store.nix +++ b/custom/modules/secrets-store.nix @@ -11,6 +11,11 @@ let options = secretOptions; }); + # Like types.path but also must exists + validFile = with types; path // { + check = x: path.check x && builtins.pathExists x; + }; + # Secret file definition secretOptions = { user = mkOption @@ -29,7 +34,7 @@ let description = "File permission (octal format)"; }; path = mkOption - { type = types.nullOr types.path; + { type = types.nullOr validFile; default = null; apply = toString; description = "File to include in the secret store";