summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-07 23:32:28 +0200
committertv <tv@krebsco.de>2016-06-07 23:34:16 +0200
commita431e036e335d688aa8e59e039dd86fa1eefdc2a (patch)
treec74428a52c27c5d126ab057138d326aa62db29e6 /krebs
parent567800c98e7f17ead15aa99f388d4a91c2f58653 (diff)
krebs.git: move assert to etcDir's type
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/git.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix
index 4fec38579..db0b6b0ab 100644
--- a/krebs/3modules/git.nix
+++ b/krebs/3modules/git.nix
@@ -63,7 +63,11 @@ let
description = "Directory used to store repositories.";
};
etcDir = mkOption {
- type = types.str;
+ type = mkOptionType {
+ name = "${types.absolute-pathname.name} starting with `/etc/'";
+ check = x: types.absolute-pathname.check x && hasPrefix "/etc/" x;
+ merge = mergeOneOption;
+ };
default = "/etc/git";
};
repos = mkOption {
@@ -314,7 +318,7 @@ let
system.activationScripts.git-init = "${init-script}";
# TODO maybe put all scripts here and then use PATH?
- environment.etc."${etc-base}".source =
+ environment.etc.${removePrefix "/etc/" cfg.etcDir}.source =
scriptFarm "git-ssh-authorizers" {
authorize-command = makeAuthorizeScript (map (rule: [
(map getName (toList rule.user))
@@ -642,9 +646,5 @@ let
'';
};
- etc-base =
- assert (hasPrefix "/etc/" cfg.etcDir);
- removePrefix "/etc/" cfg.etcDir;
-
in
out