nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.16k stars 86 forks source link

nginx cannot use persistent mounted directories #87

Closed danwdart closed 1 year ago

danwdart commented 2 years ago

I tried pointing nginx to the persistence mounted directories and it kept saying everything was "permission denied", which was weird because /bin/sh as the nginx user can access the mounted files, but the nginx process itself can't.

Is there any reason for this¸ or config for this, is it intentional or a bug? I'm using nixos.nix as environment.persistence and have a list of directories to pull in from my persistence directory.

As a workaround I have to point nginx to the /persist directory instead of where it's mounted to.

Thanks

TyberiusPrime commented 1 year ago

It might be one of the protections that nixos throws on the systemd service by default?

danwdart commented 1 year ago

I think it might have been something to do with the fact that nginx will not accept /home/... as a location.

I think I might have been able to tell nginx not to worry about it with services.nginx.serviceConfig.ProtectHome = "read-only", but I don't remember as I don't use persistence on the current machine.

I'm happy to close this and reopen if it happens again.