I am going crazy, help. Can't rebuild Permission error

building the system configuration…
error:
… while setting up the build environment

   error: filesystem error: symlink_status: Permission denied [/home/yada/.config]

Command ‘nix --extra-experimental-features ‘nix-command flakes’ build --print-out-paths ‘/etc/nixos/#nixosConfigurations.“default”.config.system.build.toplevel’ --no-link’ returned non-zero exit status 1.

Not a lot of details. Best would be to publish the whole config and whole error.

When was the last time you were able to build the system configuration, and what is the diff on this configuration from then? This diff and the full error would be next best.

Failing that, at least show the lines in your config referring to /home/yada/.config or what you are trying to achieve.

Guess at the moment is something about how you are doing things conflicts with some sort of pure evaluation mechanism. Could also be a build instead of eval error because nixbld doesn’t have access to your home folder. Very hard to be sure of anything with such limited info.

2 Likes

My Flake.nix

My configuration.nix

Today, is the day this happened, I have been rebuilding rather well. I have home-manager installed.

Thats the full error. Even with –show-trace

Do you mean your whole error is:

building the system configuration…
error:
… while setting up the build environment

   error: filesystem error: symlink_status: Permission denied [/home/yada/.config]

Command ‘nix --extra-experimental-features ‘nix-command flakes’ build --print-out-paths ‘/etc/nixos/#nixosConfigurations.“default”.config.system.build.toplevel’ --no-link’ returned non-zero exit status 1.

?

Thanks for posting parts of your config. Unless ./hardware-configuration.nix or ./yanix/hosts.nix have something directly referring to $HOME/.config, I don’t quickly see you trying to do anything with that folder directly, so that makes me think that something weird is going on. If you revert changes to your flake.lock does it build? That would hopefully help clarify whether it’s something you’ve written vs. something you’ve imported. Also what are the permissions on your $HOME and $HOME/.config folders?

I should also ask, are you running nixos-rebuild as root or your unprivileged user?

I have done both bro/siz

nixos-rebuild switch –flake /etc/nixos/#default –elevate=sudo even

Hey I have a feeling it has to do with how i ended it. Please confirm?

nixos#default
nixos/#default

Nope, hit the same error

Where are your flake.nix and configuration.nix files located? Are they in /etc/nixos or somewhere else?

Also, please post the output of this command:

ls -ld /home $HOME $HOME/.config; nix --version

s -ld /home $HOME $HOME/.config; nix --version ~ as 🧙 0s
drwxr-xr-x - yada 1 Aug 01:32  /home/yada/.config
drwxr-xr-x - root 2 Sep 2025 󱂵 /home
drwx–x–x - yada 5 Aug 18:39  /home/yada
nix (Nix) 2.34.8

My flake and configuration are in /etc/nixos, I use home manager

P.s I also thought this to be a problem since i had a mutable file or is it editable that changed my hosts.nix. In short I had hosts.nix in /etc/nixos refrence a file in /home/yada. Thinking this might be the problem, I moved this file to /etc/nixos. However same problem.

Is this really what it says or is there a typo?

I don’t think there are enough letters in the permission string drwx-x-x

Also actually… nothing has a user? They just have groups? That seems really wrong…

I have been changing permissions tryna make it work. I figured if groups and others had the right to execute but not read. Then maybe nixbld would be able to execute something without my security being compromised. I don’t know now, just been messing with permission to make this work.

drwxr-xr-x - yada  1 Aug 01:32  /home/yada/.config
drwxr-xr-x - root  2 Sep  2025 󱂵 /home
drwx–x–x - yada  5 Aug 18:39  /home/yada

Makes it looks like the first two have group yada and the middle has group root, but none of them have a named user (hence -).

Maybe show

ls -ldn /home $HOME $HOME/.config and id. The -n adds numeric ids and the id shows which ones you have. More generally I think the ids have somehow gotten messed up on your machine.

Also the preformmated text button makes stuff a lot more readable (Ctrl-E or ``` also works).

Really?
drwxr-xr-x - 1000 1 Aug 01:32  /home/yada/.config
drwxr-xr-x - 0 2 Sep 2025 󱂵 /home
drwx–x–x - 1000 5 Aug 18:39  /home/yada

uid=1000(yada) gid=100(users) groups=100(users),1(wheel),57(networkmanager),67(libvirtd),1000(docker),1001(dockergroup),1002(wireshark)

I don’t know how you arrived to that conclusion from an ls command. I use eza instead of ls, could this be why?

Eza omits groups by default. That might have added to the confusion.

2 Likes

so everything is fine on that end? right?

Update

Kinda feels like the update is beginning to behave, not fully installed but currently downloading. However it did this too before it started making my head hurt.

… yes, it’s very surprising that when someone asks you run one command you silently substitute another.

They didn’t. It’s their shell that did, maybe even without them realising until getting asked.

But yeah, whenever someone asks me to run ls and share the output, I use \ls such that my shell won’t resolve aliases, as I am aware of the alias and the way out.

2 Likes

Not necessarily intentional, Like NobbZ said, I have been using an alias for long its become second nature. I didn’t think there was much to it until I figured it might be the cause of confusion. Sorry

2 Likes

So update finally worked. Honestly I don’t know what fixed it among the many things that I tried