$ sudo nix-env --list-generations --profile /nix/var/nix/profiles/system ... 600 2020-01-25 21:01:11 601 2020-02-03 13:44:19 602 2020-02-09 14:06:20 603 2020-02-09 14:11:11 604 2020-02-11 00:02:43 605 2020-02-13 12:26:22 606 2020-02-16 16:40:02 (current)
How could I get the commit / channel generation (is this a thing?) for a Nixos generation - and potentially rollback the channel to it?
Or in other words, how can I rollback my 'channel state' to what it was at generation 605?
Why I want to know is because I did a
sudo nix-channel --update, and
sudo nixos-rebuild switch few days ago - however whatever package updates took place - resulted in an unstable system.
So to mitigate this, I booted and continue to use an old generation (
I now want to update a specific package in my Nixos system configuration, and base the changes on
605 as opposed to the latest
I did find https://stackoverflow.com/questions/39090387/how-to-undo-nix-channel-update (
nix-channel --rollback..) however I may have updated the channels a few times - so the 'last' channel state might not be what I need.
I did notice you can specify a channel generation number as a parameter to this command - but I'm not sure what is the relationship between that and the nixos generation? It does not seem to be the same thing as I tried for
605 with the following results:
sudo nix-channel --rollback 605 error: generation 605 does not exist error: program '/nix/store/cs47wjxwiqgyl1nkjnksyf3s2rb93piq-nix-2.3.2/bin/nix-env' failed with exit code 1