summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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