Open BloodStainedCrow opened 3 months ago
After trying unsuccessfully to get a modified DATA_DIR to work, I have concluded that if changed uptime-kuma will fail to start. I am not sure why exactly this happens. If the authors of the package could help explain why, I would be very grateful!
Our Uptime Kuma's systemd service is hardened.
https://github.com/NixOS/nixpkgs/blob/febd932858cfbc93d920a2ed6b9d852e93d3ad00/nixos/modules/services/monitoring/uptime-kuma.nix#L51-L72
ProtectSystem=strict
means the entire file system hierarchy is mounted read-only,
StateDirectory=uptime-kuma
is used to make /var/lib/uptime-kuma
writable.
For more info, see man 5 systemd.exec
.
Also, ReadWritePaths
and SupplementaryGroups
(I think it still works with DynamicUser=true
) might be useful.
Describe the bug
Setting a value for DATA_DIR results in
The option 'services.uptime-kuma.settings.DATA_DIR' has conflicting definition values
Steps To Reproduce
Steps to reproduce the behavior:
services.uptime-kuma = { enable = true; settings = { DATA_DIR = "/mnt/tank/uptime-kuma/data"; }; };
to your configuration.nixExpected behavior
The default value of
/var/lib/uptime-kuma/
gets overwritten by/mnt/tank/uptime-kuma/data
Screenshots
Additional context
This is a result of the defualt value for DATA_DIR not being labeled as
mkDefault
in it's definitionNotify maintainers
@JulienMalka
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.