summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-13 01:37:51 +0200
committertv <tv@krebsco.de>2016-06-13 01:38:58 +0200
commitfcfe4b646153e36aa9c8485693a13ae83c83a44d (patch)
treed32028b6d6906eaed25a96f7fa3d2a51764fa8f2
parent2adb41310c16c43546a6855a1f6dbcc1c96dc344 (diff)
types.file-mode: init
-rw-r--r--krebs/4lib/types.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index 4742877a7..2f9828bb0 100644
--- a/krebs/4lib/types.nix
+++ b/krebs/4lib/types.nix
@@ -163,7 +163,7 @@ types // rec {
secret-file = submodule ({ config, ... }: {
options = {
path = mkOption { type = str; };
- mode = mkOption { type = str; default = "0400"; };
+ mode = mkOption { type = file-mode; default = "0400"; };
owner = mkOption {
type = user;
default = config.krebs.users.root;
@@ -293,6 +293,12 @@ types // rec {
};
};
+ file-mode = mkOptionType {
+ name = "file mode";
+ check = x: isString x && match "[0-7]{4}" x != null;
+ merge = mergeOneOption;
+ };
+
haskell.conid = mkOptionType {
name = "Haskell constructor identifier";
check = x: