summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/git.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-07 22:49:26 +0200
committertv <tv@krebsco.de>2016-06-07 22:49:26 +0200
commita3644a38a5f8af779d7db64cdaa6468240ae37d3 (patch)
treec623665295ca3fdcb50275e00f21ac36bc5865c7 /krebs/3modules/git.nix
parentc655e1246daa04abc4cd83dbb62b86dda1d357d4 (diff)
krebs.git: make user configurable
Diffstat (limited to 'krebs/3modules/git.nix')
-rw-r--r--krebs/3modules/git.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix
index 9bc56fc85..aabf4614f 100644
--- a/krebs/3modules/git.nix
+++ b/krebs/3modules/git.nix
@@ -87,6 +87,14 @@ let
access and permission rules for git repositories.
'';
};
+
+ user = mkOption {
+ type = types.user;
+ default = {
+ name = "git";
+ home = "/var/lib/git";
+ };
+ };
};
# TODO put into krebs/4lib/types.nix?
@@ -303,16 +311,15 @@ let
]) (filter (rule: rule.perm.allow-receive-ref != null) cfg.rules));
};
- # TODO cfg.user
- users.users.git = rec {
+ users.users.${cfg.user.name} = {
+ inherit (cfg.user) home name uid;
+ createHome = true;
description = "Git repository hosting user";
- name = "git";
shell = "/bin/sh";
openssh.authorizedKeys.keys =
mapAttrsToList (_: makeAuthorizedKey git-ssh-command)
(filterAttrs (_: user: isString user.pubkey)
config.krebs.users);
- uid = genid name;
};
};