|
|
|
@ -75,27 +75,24 @@ in |
|
|
|
|
|
|
|
|
|
users.groups.gollum = { }; |
|
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [ |
|
|
|
|
"d '${cfg.stateDir}' - ${config.users.users.gollum.name} ${config.users.groups.gollum.name} - -" |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
systemd.services.gollum = { |
|
|
|
|
description = "Gollum wiki"; |
|
|
|
|
after = [ "network.target" ]; |
|
|
|
|
wantedBy = [ "multi-user.target" ]; |
|
|
|
|
path = [ pkgs.git ]; |
|
|
|
|
|
|
|
|
|
preStart = let |
|
|
|
|
userName = config.users.users.gollum.name; |
|
|
|
|
groupName = config.users.groups.gollum.name; |
|
|
|
|
in '' |
|
|
|
|
# All of this is safe to be run on an existing repo |
|
|
|
|
mkdir -p ${cfg.stateDir} |
|
|
|
|
preStart = '' |
|
|
|
|
# This is safe to be run on an existing repo |
|
|
|
|
git init ${cfg.stateDir} |
|
|
|
|
chmod 755 ${cfg.stateDir} |
|
|
|
|
chown -R ${userName}:${groupName} ${cfg.stateDir} |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
serviceConfig = { |
|
|
|
|
User = config.users.users.gollum.name; |
|
|
|
|
Group = config.users.groups.gollum.name; |
|
|
|
|
PermissionsStartOnly = true; |
|
|
|
|
ExecStart = '' |
|
|
|
|
${pkgs.gollum}/bin/gollum \ |
|
|
|
|
--port ${toString cfg.port} \ |
|
|
|
|