Why is nix-env updating python 3.13 to python3.14a2 on stable channel?

(nix-env, Arch Linux)
All of a sudden nix package manager has lost its mind. Even after a complete reinstall (single-user mode, shared with my network), anytime I try to update I get stuck with an alpha reason of python when I explicitly installed the stable 24.11 channel with python313.

I had been running the standard unstable channel for well over a year and I’ve never seen this before. Please help!

Update how? And please list your channels with nix-channel --list.

Though frankly nix-env is an antipattern.

nix-channel --list

nixpkgs https://nixos.org/channels/nixpkgs-unstable

This was the original channel from the install script; as mentioned, I tried to switch to a stable channel, got the same results. The only difference between my previous installs and this one is that I installed it as single-user.

To upgrade, I run these commands on the host (same as always):

nix-channel --update
nix-env --upgrade --verbose
nix-collect-garbage --delete-older-than 14d

When my VM boots, it syncs my current user configs/links with the host (via NFS).

With which commands?

I think it was this one:

nix-channel --add https://nixos.org/channels/nixpkgs-stable

nixpkgs-stable is not a channel, the stable channel would be nixos-24.11 (for now, until the next stable release in 4 months, when it will become nixos-25.05, etc.)

Sorry, I forgot - I also tried nixos-24.11. I don’t use bash, so I didn’t remember to check my history there. I just don’t understand why this just started happening. I had originally installed the package manager a long time ago, on 40+ VMs as well as my host, with never any problems. My NixOS VMs have also been smooth sailing; upgraded on 1/6, both stable and unstable channels.

Well you have to add the stable channel first, which I don’t see evidence that you did?

OK, here it is:

$ nix-channel --add https://nixos.org/channels/nixos-24.11 nixpkgs
$ nix-channel --list
nixpkgs https://nixos.org/channels/nixos-24.11
$ nix-channel --update
unpacking 1 channels...
$ nix-env --upgrade --dry-run
(dry run; not doing anything)
upgrading 'python3-3.13.1' to 'python3-3.14.0a2'
these 23 paths will be fetched (72.15 MiB download, 186.17 MiB unpacked):
  /nix/store/p6k7xp1lsfmbdd731mlglrdj2d66mr82-bash-5.2p37
  /nix/store/hl3iw85v12gh9mwgvr9yfgjgy0rk81hb-bzip2-1.0.8
  /nix/store/8sgvk9wjq9vfz5irkl4436yhpfr10njq-expat-2.6.4
  /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib
  /nix/store/j8rzqx7farv0w3isp9z943zy437zk02f-gcc-13.3.0-libgcc
  /nix/store/hq7m89gp4kafmj8rr0f5sy2qyl7jq479-gdbm-1.24-lib
  /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36
  /nix/store/lw7psn749bfn2nrn943jdh68hh2im8yl-libffi-3.4.6
  /nix/store/qwjjm4j652ck9izaid7bz63s4hd5bnha-libidn2-2.3.7
  /nix/store/6pqgj71r0850b0cd95yxx0d52zax016i-libunistring-1.2
  /nix/store/sbc37bmgpzr7wvlbm9lgf4y6q6dyz40q-libxcrypt-4.4.36
  /nix/store/77yxcw58nmqx2c67a7srpfxxp40j5rbl-mailcap-2.1.54
  /nix/store/aqga8f06jxy5a6ci4na35v7n09j8i74f-mpdecimal-4.0.0
  /nix/store/1p1j0iv3c909kcs4d5300kcsnlwmbwyj-ncurses-6.4.20221231
  /nix/store/k1dsk0zyq43pvi7f76is2rx6l4aphm5z-openssl-3.3.2
  /nix/store/9msz0slmz60gn9lmk4qdrxkdsq672sb8-python3-3.14.0a2
  /nix/store/6v86nvyvjhwavy75958rd6jrpdviwdja-python3-3.14.0a2-debug
  /nix/store/n0q4xhb9z19f0rfd1i8frw7a3ip3rgar-readline-8.2p13
  /nix/store/bbd59cqw259149r2ddk4w1q0lr2fch8c-sqlite-3.46.1
  /nix/store/dfsiy184c8z6gf5x6cqfyahxv9g16828-tzdata-2024b
  /nix/store/2d5spnl8j5r4n1s4bj1zmra7mwx0f1n8-xgcc-13.3.0-libgcc
  /nix/store/bdpc1864983kf51r3cznbrvnlkv4d9ff-xz-5.6.3
  /nix/store/bzk3q2l71qwhycsip23y6rl5n881la4n-zlib-1.3.1

The only difference with the unstable channel is that only python3 was to be upgraded. On a side note, it’s also adding the debug package for python.

Honestly I would just stop using nix-env.
https://stop-using-nix-env.privatevoid.net/

If you’re going to use nix-env at all, use a declarative environment so that you can control what goes into the profile, e.g. Nixpkgs Reference Manual

I should point out that nix’s strength is not as a package manager, and it does little good to think of it that way. It is a build tool foremost, and using something like buildEnv you can control how the environment is built, and deploy that.

Thanks, I should have thought of this before. I had played around with nix profile a while back, but didn’t try again when I decided to create my new shared environment. Just reinstalled everything, tested multiple updates, and all is well.