Questions after a massive MASSIVE channel update

nix-command as it was mentioned or you can use nix-env (check my nix-profiles and nix-diffs-advanced aliases https://codeberg.org/BlastboomStrice/dotfiles/src/branch/main/.config/nixos-config/modules/nixos/aliases.nix) :))

1 Like

I already have nix-command and flake as experimental stuff

confugration.nix:

  # extraOptions = "experimental-features = nix-command";
  nix.settings.experimental-features = "nix-command flakes";
  nix.settings.auto-optimise-store = true; # deduplicate same content files in the store

I was wondering if there is an extra tool to add as experimental stuff. Like profile or diff-closures. Something that ‘nix’ unified repl could not reach. As I said, the command runs in the blink of an eye. That’s a bit fast to my liking :wink:

I have to check with nix-env. I have removed nix-env from my usage when I switched to nixos rather than ubuntu+nix.

sudo nix-env --profile /nix/var/nix/profiles/system --list-generations

=> near instant output and also output only 1 system profile

But it does not list any of my generations: whereas the generations links are clearly visible here /nix/var/nix/profiles/system-profiles/

Also in your aliases, I am puzzled by this one:

nix-diffs-advanced = "nix-profiles && read -r -p \"Insert Generation Number: \" nixgen && nix store diff-closures /nix/var/nix/profiles/system- /nix/var/nix/profiles/system-\"$nixgen\"-link && unset nixgen";

What is this? /nix/var/nix/profiles/system- ? compared to /nix/var/nix/profiles/system

I’m gonna try with two complete names /nix/var/nix/profiles/system-profiles/$genA /nix/var/nix/profiles/system-profiles/$genB

EDIT: this command works well:/nix/var/nix/profiles/system-profiles/$genA /nix/var/nix/profiles/system-profiles/$genB

nix-diff: ∅ → 1.0.21, +4145.3 KiB
nvd: ∅ → 0.2.4, +49.4 KiB

I like it. Super fast, super concise. Just minimal info. nix store diff-closures is my new friend :wink: I have to train a bit on the other two tools ‘nix-diff‘ and ‘nvd’. I have just tried a monkey command and was not succesful on the first try

EDIT2: possibily the nix profiles diff-closures –profile …./system does not produce anything for now because all my latest generations are indeed local packages variations… But that means it may not track hash change in the store. Not sure, just an assumption. I’ll retest nix profiles diff-closures in another context to check the usage.

Ah hm, I think I confused you with my alias naming.

Anything that ends with an extra “s” is stuff I made; nix-profiles, nix-diffs, nix-upgrades, etc.
Oops, should have made that clearer.

Now for the actual commands, any (real) nix comand that has a hyphen (like nix-env) is a stable command. Any command with a space (like nix profile, nix store etc.) are part of the experimental commands which you indeed have enabled:)

About slowing down commands, not sure how to do it, but I tend to add a waitForInput (check the alias) which asks the user to press any button before continuing to the next command of my aliases.

About

nix-diffs-advanced = "nix-profiles && read -r -p \"Insert Generation Number: \" nixgen && nix store diff-closures /nix/var/nix/profiles/system- /nix/var/nix/profiles/system-\"$nixgen\"-link && unset nixgen";

Well I noticed that in the /nix/var/nix/profiles/system that are the profiles that end with $genNumber/-link so with that command I ask the user to give 1 number and compares the differences to the currently used generation.

I tried to add documentation to my dotfiles, but oof, apparently I should try better​:sweat_smile:

1 Like

Thanks to the tools and commands indicated here, I can see the diff between two generations, and there is this one:

glibc: -2729.4 KiB
glibc-multi: 2.40-218 → ∅, -24.3 KiB

when I run:

nix store diff-closures /nix/var/nix/profiles/system-profiles/mygenerationnameA/ /nix/var/nix/profiles/system-profiles/mygenerationnameB
1 Like

It’s ok :slight_smile: I found the solution thanks to you, trying to play with nix store –diff-profiles and it worked!

1 Like