When starting the service via a nixos rebuild, the following error occurs.
× akkoma.service - Akkoma social network
Loaded: loaded (/etc/systemd/system/akkoma.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-09-15 00:38:38 HKT; 4min 38s ago
Docs: https://docs.akkoma.dev/stable/
Process: 1172485 ExecStartPre=/nix/store/aaaaaaaaaaaaaaaaaaaaaa-akkoma-env/bin/pleroma_ctl migrate (code=exited, status=1/FAILURE)
Process: 1172495 ExecStopPost=/nix/store/bbbbbbbbbbbbbbbbbb-coreutils-9.3/bin/rm -f /run/akkoma/socket (code=exited, status=0/SUCCESS)
IP: 0B in, 0B out
CPU: 100ms
Sep 15 00:38:38 koumakan systemd[1]: Starting Akkoma social network...
Sep 15 00:38:38 koumakan pleroma_ctl[1172485]: /nix/store/aaaaaaaaaaaaaaaaaaaaaa-akkoma-env/bin/pleroma_ctl: line 9: /run/akkoma/cookie: Permission
denied
Sep 15 00:38:38 koumakan systemd[1]: akkoma.service: Control process exited, code=exited, status=1/FAILURE
Sep 15 00:38:38 koumakan systemd[1]: akkoma.service: Failed with result 'exit-code'.
Sep 15 00:38:38 koumakan systemd[1]: Failed to start Akkoma social network.
However, when restarting the service manually, everything works as intended.
This issue aims to resolve the problem and for the service to start correctly with a rebuild.