Merge pull request #93001 from aanderse/gitolite
nixos/gitolite: provision data directory only before service begins
This commit is contained in:
commit
e99389a942
|
@ -27,7 +27,10 @@ in
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "/var/lib/gitolite";
|
default = "/var/lib/gitolite";
|
||||||
description = ''
|
description = ''
|
||||||
Gitolite home directory (used to store all the repositories).
|
The gitolite home directory used to store all repositories. If left as the default value
|
||||||
|
this directory will automatically be created before the gitolite server starts, otherwise
|
||||||
|
the sysadmin is responsible for ensuring the directory exists with appropriate ownership
|
||||||
|
and permissions.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -149,14 +152,6 @@ in
|
||||||
};
|
};
|
||||||
users.groups.${cfg.group}.gid = config.ids.gids.gitolite;
|
users.groups.${cfg.group}.gid = config.ids.gids.gitolite;
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"d '${cfg.dataDir}' 0750 ${cfg.user} ${cfg.group} - -"
|
|
||||||
"d '${cfg.dataDir}'/.gitolite - ${cfg.user} ${cfg.group} - -"
|
|
||||||
"d '${cfg.dataDir}'/.gitolite/logs - ${cfg.user} ${cfg.group} - -"
|
|
||||||
|
|
||||||
"Z ${cfg.dataDir} 0750 ${cfg.user} ${cfg.group} - -"
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.gitolite-init = {
|
systemd.services.gitolite-init = {
|
||||||
description = "Gitolite initialization";
|
description = "Gitolite initialization";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -167,13 +162,19 @@ in
|
||||||
GITOLITE_RC_DEFAULT = "${rcDir}/gitolite.rc.default";
|
GITOLITE_RC_DEFAULT = "${rcDir}/gitolite.rc.default";
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = mkMerge [
|
||||||
|
(mkIf (cfg.dataDir == "/var/lib/gitolite") {
|
||||||
|
StateDirectory = "gitolite gitolite/.gitolite gitolite/.gitolite/logs";
|
||||||
|
StateDirectoryMode = "0750";
|
||||||
|
})
|
||||||
|
{
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
Group = cfg.group;
|
Group = cfg.group;
|
||||||
WorkingDirectory = "~";
|
WorkingDirectory = "~";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
}
|
||||||
|
];
|
||||||
|
|
||||||
path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash pkgs.diffutils config.programs.ssh.package ];
|
path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash pkgs.diffutils config.programs.ssh.package ];
|
||||||
script =
|
script =
|
||||||
|
|
Loading…
Reference in New Issue