mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/gollum: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
parent
191e4b0755
commit
74b34535fc
1 changed files with 6 additions and 9 deletions
|
@ -75,27 +75,24 @@ in
|
||||||
|
|
||||||
users.groups.gollum = { };
|
users.groups.gollum = { };
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d '${cfg.stateDir}' - ${config.users.users.gollum.name} ${config.users.groups.gollum.name} - -"
|
||||||
|
];
|
||||||
|
|
||||||
systemd.services.gollum = {
|
systemd.services.gollum = {
|
||||||
description = "Gollum wiki";
|
description = "Gollum wiki";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [ pkgs.git ];
|
path = [ pkgs.git ];
|
||||||
|
|
||||||
preStart = let
|
preStart = ''
|
||||||
userName = config.users.users.gollum.name;
|
# This is safe to be run on an existing repo
|
||||||
groupName = config.users.groups.gollum.name;
|
|
||||||
in ''
|
|
||||||
# All of this is safe to be run on an existing repo
|
|
||||||
mkdir -p ${cfg.stateDir}
|
|
||||||
git init ${cfg.stateDir}
|
git init ${cfg.stateDir}
|
||||||
chmod 755 ${cfg.stateDir}
|
|
||||||
chown -R ${userName}:${groupName} ${cfg.stateDir}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = config.users.users.gollum.name;
|
User = config.users.users.gollum.name;
|
||||||
Group = config.users.groups.gollum.name;
|
Group = config.users.groups.gollum.name;
|
||||||
PermissionsStartOnly = true;
|
|
||||||
ExecStart = ''
|
ExecStart = ''
|
||||||
${pkgs.gollum}/bin/gollum \
|
${pkgs.gollum}/bin/gollum \
|
||||||
--port ${toString cfg.port} \
|
--port ${toString cfg.port} \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue