nixos/frab: replace deprecated usage of PermissionsStartOnly

see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
Aaron Andersen 2019-03-18 20:20:17 -04:00
parent 89dae4b1ae
commit 1540a85458

View file

@ -182,16 +182,16 @@ in
users.groups = [ { name = cfg.group; } ]; users.groups = [ { name = cfg.group; } ];
systemd.tmpfiles.rules = [
"d '${cfg.statePath}/system/attachments' - ${cfg.user} ${cfg.group} - -"
];
systemd.services.frab = { systemd.services.frab = {
after = [ "network.target" "gitlab.service" ]; after = [ "network.target" "gitlab.service" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
environment = frabEnv; environment = frabEnv;
preStart = '' preStart = ''
mkdir -p ${cfg.statePath}/system/attachments
chown ${cfg.user}:${cfg.group} -R ${cfg.statePath}
mkdir /run/frab -p
ln -sf ${pkgs.writeText "frab-database.yml" databaseConfig} /run/frab/database.yml ln -sf ${pkgs.writeText "frab-database.yml" databaseConfig} /run/frab/database.yml
ln -sf ${cfg.statePath}/system /run/frab/system ln -sf ${cfg.statePath}/system /run/frab/system
@ -204,7 +204,6 @@ in
''; '';
serviceConfig = { serviceConfig = {
PermissionsStartOnly = true;
PrivateTmp = true; PrivateTmp = true;
PrivateDevices = true; PrivateDevices = true;
Type = "simple"; Type = "simple";
@ -213,6 +212,7 @@ in
TimeoutSec = "300s"; TimeoutSec = "300s";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "10s"; RestartSec = "10s";
RuntimeDirectory = "frab";
WorkingDirectory = "${package}/share/frab"; WorkingDirectory = "${package}/share/frab";
ExecStart = "${frab-rake}/bin/frab-bundle exec rails server " + ExecStart = "${frab-rake}/bin/frab-bundle exec rails server " +
"--binding=${cfg.listenAddress} --port=${toString cfg.listenPort}"; "--binding=${cfg.listenAddress} --port=${toString cfg.listenPort}";