secrets-store: check if files exist

This commit is contained in:
Michele Guerini Rocco 2020-10-26 02:23:58 +01:00
parent a25ce28fe9
commit 5928c45194

View File

@ -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";