3
0
Fork 0
forked from mirrors/nixpkgs

nixos/hedgedoc: Do not set StateDirectory to an absolute path

Commit 8109d8a set the `StateDirectory=` option of the systemd service
configuration to the value of `cfg.workDir` which is wrong, according
to dasJ [1]. This commit resolves this issue by stripping the
`/var/lib/` prefix from `cfg.workDir`.

[1] https://github.com/NixOS/nixpkgs/pull/172824#issuecomment-1130350412
This commit is contained in:
M. A 2022-06-13 15:33:12 +00:00
parent 13f08d71ce
commit becff58579

View file

@ -1031,7 +1031,8 @@ in
'';
serviceConfig = {
WorkingDirectory = cfg.workDir;
StateDirectory = [ cfg.workDir cfg.configuration.uploadsPath ];
StateDirectory = [ (builtins.replaceStrings [ "/var/lib/" ] [ "" ] cfg.workDir) ];
ReadWritePaths = [ cfg.configuration.uploadsPath ];
ExecStart = "${cfg.package}/bin/hedgedoc";
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
Environment = [