nixos/gollum: replace deprecated usage of PermissionsStartOnly

see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
Aaron Andersen 2019-02-23 18:00:03 -05:00
parent 191e4b0755
commit 74b34535fc

View File

@ -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} \