secrets-store: check if files exist
This commit is contained in:
parent
386efec7dc
commit
4aa14e6b8b
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user