Very new to NixOS, not so new to linux in general. I’ve needed a bit more fresh package versions and tried to update my channels from 24.05 to 24.11.
I’ve already ran:
What you’re missing and what is a pitfall that catches many new Nix users is that nix-channel is user-specific. If you run it as root via sudo, you’re modifying a totally separate set of channels than if you run it without.
You added the channel to your user’s channel list and then updated the root user’s channels. Now that you know that channels are per-user, I think you see why that didn’t do anything. (You also used the wrong identifier: nixos vs. nixpkgs; choose one.)
f**k
everything else in the system functions normal
guess i’ll just reboot and select previous config?
[zamonary1@nixos:~]$ sudo nixos-rebuild --upgrade switch -I /etc/nixos/configuration.nix
unpacking channels...
error:
… while evaluating the attribute 'config'
at /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/lib/modules.nix:334:9:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/lib/modules.nix:334:18:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: file 'nixos-config' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
building Nix...
error:
… while evaluating the attribute 'config'
at /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/lib/modules.nix:334:9:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/lib/modules.nix:334:18:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: file 'nixos-config' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
/nix/store/syl4snn859kpqvn9qh91kr7n9i4dws04-bash-5.2p32/bin/bash: /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/nixos/modules/installer/tools/get-version-suffix: No such file or directory
building the system configuration...
error:
… while evaluating the attribute 'config.system.build.toplevel'
at /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/lib/modules.nix:334:9:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/store/kfj8b13cpl2v8jqzw1bvxlmgzjkrl874-source/lib/modules.nix:334:18:
333| options = checked options;
334| config = checked (removeAttrs config [ "_module" ]);
| ^
335| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: file 'nixos-config' was not found in the Nix search path (add it using $NIX_PATH or -I)
That’s just the result of you passing -I /etc/nixos/configuration.nix. I believe that sets the NIX_PATH to that value and now there’s obviously no nixos-config in it anymore.
What you meant to do was probably -I nixos-config=/etc/nixos/configuration.nix.
Which is also not necessary anyway, since that’s the default value.
The simplest solution here that does not require messing with NIX_PATH or using the -I flag is:
Keep the entry-point to your config in /etc/nixos/configuration.nix
Delete all the user nixpkgs channels
Keep exactly one root channel named nixos that points to your desired channel, by running sudo nix-channel --add <url> nixos (of course replace <url> here), then run sudo nix-channel --update