NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.81k stars 1.52k forks source link

nix daemon: auto reload when config changes #8939

Open roberth opened 1 year ago

roberth commented 1 year ago
Troubleshooting a silly mistake I, an experienced but human Nix user, made while updating nix.conf **Describe the bug** I can't get the nix-daemon to trust my user. **Steps To Reproduce** 1. Install nix on an M2 2. Add to `/etc/nix/nix.conf` (example with `roberth` for the user name. This user is also in the `staff` group.) ``` trusted-users = @staff roberth ``` 3. `sudo launchctl kickstart system/org.nixos.nix-daemon` 4. `nix store ping` Result has: ``` Trusted: 0 ``` 6. Try a remote build. Log has ``` > error: you are not privileged to build input-addressed derivations ```

Expected behavior

Not even a kickstart should be necessary. It should just pick up the change.

nix-env --version output

Additional context

Priorities

Add :+1: to issues you find important.

abathur commented 1 year ago

Can you try with kickstart -k? I'm not exactly sure how to interpret what the manpage says, but it might be material:

-k       If the service is already running, kill the running instance before restarting the service.
roberth commented 1 year ago

That worked. Thank you! It's a small and silly mistake to make, but nonetheless I think nix-daemon should watch its config file so that none of this is necessary.

fricklerhandwerk commented 1 year ago

Triaged in Nix maintainers meeting:

nixos-discourse commented 1 year ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-09-22-nix-team-meeting-minutes-88/33343/1