Hi! I wanted to give myself permissions to edit /etc/nixos directory. So I created group nixos, added myself to it, changed group on that folder and its content and chmoded 775. And generally it works, but sometimes the permissions return to 755 on that folder… Group ownership stays on nixos.
Why is this happening? It seems like NixOs interprates that as an error and fixes it.
Is there a way to declare certain directories’ permissions?
You can try using tmpfiles (yes, despite the name), but chances are you’re doing this to make your configuration.nix writeable by your user. I’d suggest putting the config in your home directory instead, and telling nix where it is by setting nixos-config=/home/user/some/subdir in your nix path instead.
Also be careful with auto updates if you do this, user processes could in theory change your config under your feet, so make sure to keep it in git and check for changes before you nixos-rebuild.
Yes, that’s because of the line in stage-2-init.sh. I’m just questioning why we have that line in stage-2-init.sh. It seems completely unnecessary and creates confusion like this.