Howto downgrade nix-daemon?

It seems that my local proxy env vars override config is not working after upgrade to nix2.24. I tried downgrade. But even when switched to nixos-24.05, showing outputs.nixosConfigurations.nixos-gtr7.config.nix.package = «derivation /nix/store/3s2v85hm6jrhbz89bk7911x3x0lfp53p-nix-2.18.8.drv» at nix repl result, the systemd service unit nix-daemon remains being soft link of /nix/store/42lxam32cqq9sn2zdz4ym6ls2dzmfn19-nix-2.24.10/lib/systemd/system/nix-daemon.service.

is there any method to downgrade nix-daemon?

It sounds like you didn’t actually rebuild the system? Maybe because the daemon isn’t working so rebuilding doesn’t work? In that case you can just rollback to a previous system generation.

Rollback is for emergency. Although I’m building proxy router to skip this issue, which part of nix source is controlling nix-daemon version remains a question.

On NixOS, the nix daemon version is controlled by nix.package.
So either you didn’t rebuild and switch your config successfully, or you installed nix some other way somehow.

Test downgrade to 2.23, nix-daemon version switch succeed. downgrading to 2.18 is too much.

Downgrade to 2.20 errors:

$ systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER= --collect --no-ask-password --pipe --quiet --service-type=exec --unit=nixos-rebuild-switch-to-configuration --wait /nix/store/d911j151a8312px1zfj3zbdyg54821w8-nixos-system-nixo
s-gtr7-25.05.20241119.23e89b7/bin/switch-to-configuration switch
Traceback (most recent call last):
  File "/nix/store/qgw8j0j5r49y9ngq4sc6q55skyy7m1yv-systemd-boot/bin/systemd-boot", line 435, in <module>
    main()
  File "/nix/store/qgw8j0j5r49y9ngq4sc6q55skyy7m1yv-systemd-boot/bin/systemd-boot", line 418, in main
    install_bootloader(args)
  File "/nix/store/qgw8j0j5r49y9ngq4sc6q55skyy7m1yv-systemd-boot/bin/systemd-boot", line 361, in install_bootloader
    gens = get_generations()
           ^^^^^^^^^^^^^^^^^
  File "/nix/store/qgw8j0j5r49y9ngq4sc6q55skyy7m1yv-systemd-boot/bin/systemd-boot", line 213, in get_generations
    gen_list = run(
               ^^^^
  File "/nix/store/qgw8j0j5r49y9ngq4sc6q55skyy7m1yv-systemd-boot/bin/systemd-boot", line 58, in run
    return subprocess.run(cmd, check=True, text=True, stdout=stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/i69bjkxbg9n43p257nbyi2yjv01i05vp-nix-2.20.9/bin/nix-env', '--list-generations', '-p', '/nix/var/nix/profiles/system']' died with <Signals.SIGSEGV: 11>.
Failed to install bootloader
warning: error(s) occurred while switching to the new configuration

by the way, the root cause is git fetch fails .netrc parse with libcurl 8.11.0 · Issue #15496 · curl/curl · GitHub.

everything go fine after removing nix.settings.netrc-file.

I mean I very much do not think so. The ability to rollback like it’s nothing is one of nixos’s greatest strengths.

3 Likes

why would libcurl be related to systemd-boot config?

The error wasn’t from systemd-boot, it was from the part of the boot loader installation script that calls nix-env --list-generations.

Splitting hairs still doesn’t answer my question lol

I don’t think it’s splitting hairs? It seems like running most nix commands is failing because of some issue because of some libcurl bug and their netrc-file setting