Nix-channel --verbose --update outputs nothing

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:

nix-channel --add https://nixos.org/channels/nixos-24.11 nixos
sudo nix-channel --update nixpkgs
sudo rm -rf ~root/.cache/nix
sudo rm -rf ~/.cache/nix

but it did literally nothing (except for deleting the cache).
It did update some of the files but packages were left old and stable.

[zamonary1@nixos:~]$ nix-channel --list
nixos https://nixos.org/channels/nixos-24.11

[zamonary1@nixos:~]$ nix-channel --list-generations
   1   2024-11-28 13:42:58   
   2   2024-11-28 13:49:50   
   3   2024-11-28 14:04:04   (current)

Here’s another interesting thing:

[zamonary1@nixos:~]$ sudo nix-channel --update nixpkgs --verbose
unpacking channels...

[zamonary1@nixos:~]$ 

Also i would like to know, can i declare some packages to update from 24.11 or unstable, and leave the rest on stable? Any help would be appreciated

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.)

Thank you, worked! :sweat_smile:

I’m taking my words back, the system is still updating to 24.05, still cannot install latest packages. What may be the cause?

Please list both user’s channels and in what context you’re using the channel (e.g. nixos-rebuild or sudo nixos-rebuild)

i was always using sudo nixos-rebuild switch
is this the problem again?

[zamonary1@nixos:~]$ nix-channel --list
nixos https://nixos.org/channels/nixos-24.11
nixos-2411 https://nixos.org/channels/nixos-24.11

[zamonary1@nixos:~]$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-24.05

[zamonary1@nixos:~]$ 


i guess the answer is yes

Welp…

I’d highly recommend you have exactly one instance of Nixpkgs on your system and remove all the others.

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

Then simply sudo nixos-rebuild switch will work.

2 Likes

Thank you for reply, but now the systme won’t update because of following:

/nix/store/n88x8v3ah6g8kbqdxayfwr30f9c1qiwp-hplip-3.24.4/share/hplip/timedate.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/nmqxyr00in2arwrq5qd1qipsanz1yrn5-python3-3.11.10/bin/python"

stripping (with command strip and flags -S -p) in /nix/store/n88x8v3ah6g8kbqdxayfwr30f9c1qiwp-hplip-3.24.4/share/hplip /nix/store/n88x8v3ah6g8kbqdxayfwr30f9c1qiwp-hplip-3.24.4/lib/cups/backend /nix/store/n88x8v3ah6g8kbqdxayfwr30f9c1qiwp-hplip-3.24.4/lib/cups/filter /nix/store/n88x8v3ah6g8kbqdxayfwr30f9c1qiwp-hplip-3.24.4/lib/python3.11/site-packages /nix/store/n88x8v3ah6g8kbqdxayfwr30f9c1qiwp-hplip-3.24.4/lib/sane

source root is source

Running phase: patchPhase

applying patch /nix/store/icyj435rpas7a8wzsnzb41hjwza3x8fs-5bcaa7c80b7640e2da6135cdff83eba77c202407.patch

patching file src/wayland/meta-wayland-pointer-constraints.c

Hunk #1 succeeded at 929 (offset -9 lines).

Hunk #2 FAILED at 958.

1 out of 2 hunks FAILED -- saving rejects to file src/wayland/meta-wayland-pointer-constraints.c.rej

error: builder for '/nix/store/bdhnva3x839aj4i61czl7dg9i15h5b8x-mutter-47.1.drv' failed with exit code 1

error: 1 dependencies of derivation '/nix/store/wsyh3kafba3my983g4ghinmgqpyiksv9-gnome-control-center-47.1.1.drv' failed to build

error: 1 dependencies of derivation '/nix/store/dshqx69yrr9cbh1cv26nb2pz9624v4hd-gnome-shell-47.1.drv' failed to build

error: 1 dependencies of derivation '/nix/store/kqx6qaq3ll1dnmdldrb52gk3kh1qkbdr-hwdb.bin.drv' failed to build

error: 1 dependencies of derivation '/nix/store/mqr8ssq7psdsw642a28x3b7ylh5r2kkx-udev-rules.drv' failed to build

error: 1 dependencies of derivation '/nix/store/81wcnkypx2a89p0za3rpbqm856rdip72-etc.drv' failed to build

error: 1 dependencies of derivation '/nix/store/4ldz3vljnliay9gw2nnj4v265avkpwka-system-path.drv' failed to build

error: 1 dependencies of derivation '/nix/store/q1zlnvmriyfxbbhj1zz23kj34x74c9d2-nixos-system-nixos-24.11.710050.62c435d93bf0.drv' failed to build

[zamonary1@nixos:~]$

I’ve found the issue.

After disabling triple buffering everything compiles succesfully.

nixpkgs.overlays = [
#   # GNOME 46: triple-buffering-v4-46
(final: prev: {
#     mutter = prev.mutter.overrideAttrs (old: {
#       src = pkgs.fetchFromGitLab  {
#         domain = "gitlab.gnome.org";
#         owner = "vanvugt";
#         repo = "mutter";
#         rev = "triple-buffering-v4-46";
#         hash = "sha256-C2VfW3ThPEZ37YkX7ejlyumLnWa9oij333d5c4yfZxc=";
#       };
#     });
})
];