secrets-store: check if files exist
This commit is contained in:
parent
386efec7dc
commit
4aa14e6b8b
@ -11,6 +11,11 @@ let
|
|||||||
options = secretOptions;
|
options = secretOptions;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
# Like types.path but also must exists
|
||||||
|
validFile = with types; path // {
|
||||||
|
check = x: path.check x && builtins.pathExists x;
|
||||||
|
};
|
||||||
|
|
||||||
# Secret file definition
|
# Secret file definition
|
||||||
secretOptions =
|
secretOptions =
|
||||||
{ user = mkOption
|
{ user = mkOption
|
||||||
@ -29,7 +34,7 @@ let
|
|||||||
description = "File permission (octal format)";
|
description = "File permission (octal format)";
|
||||||
};
|
};
|
||||||
path = mkOption
|
path = mkOption
|
||||||
{ type = types.nullOr types.path;
|
{ type = types.nullOr validFile;
|
||||||
default = null;
|
default = null;
|
||||||
apply = toString;
|
apply = toString;
|
||||||
description = "File to include in the secret store";
|
description = "File to include in the secret store";
|
||||||
|
Loading…
Reference in New Issue
Block a user