Old profile versions not garbage collected?

Good morning y’all!

I recently moved the contents of my home partition to the home folder on the boot partition, and I’m wondering if that’s why my installation is misbehaving.

I ran:

nix-env --delete-generations old
nix-collect-garbage -d

and old generations and folders still persist! It says that it deleted a whole lot, but apparently not the stuff I was hoping it would delete!

I’m trying to reclaim lastpass-cli which seems to have gotten mixed up by my partition recreation. lol

Do I need to do a fresh install? Is there other information I can offer which can help you help me? I’d be so grateful for any direction!

okeeee so I wasn’t running with sudo …so now I did, and I’m down to just one version of lastpass-cli

if I try to remove it with nix store delete it tells me that it’s live. here’s the output of nix-store --query --roots:

/root/result -> /nix/store/v34ssgcbxssdhl5wnh2gpywabl3c0s4p-nixos-system-nixos-22.05.3737.3933d8bb912

so… my OS relies on lastpass-cli?

judging by the erratic behavior of lastpass-cli, I’m lead to believe that the credentials in this remaining installation are what are causing the issues I’m experiencing. Is there no way to reinstall it with fresh credentials?

It sounds to me like you have only deleted the generations of your user profile (or of the root user profile when you ran with sudo).

To operate on the system profile, you need to supply the flag --profile /nix/var/nix/profiles/system to every nix-env command.

What does this command output?

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

thanks so much for the reply! as I stated above, I re-ran those commands with sudo and affected the system profile. the output to that command gives:
224 2023-10-31 10:20:09 (current)

Maybe I should make a new help post for my lastpass-cli issue… :frowning:

Ah sorry, I didn’t understand that.

/root/result is a regular symlink, not one from your system profile. Normally, links to system generations in your system profile would show up in nix-store --query --roots like this:

$ nix-store --query --roots $(realpath $(which vim))
/nix/var/nix/profiles/system-1-link -> /nix/store/3dzsldqmv0a5aj7r7klr4qj496iqxkdr-nixos-system-gateway-23.05.589.a558f7ac29f
/nix/var/nix/profiles/system-2-link -> /nix/store/7fwn2dswi9qph8qv2gfzgv2cshxx7jx1-nixos-system-gateway-23.05.589.a558f7ac29f

It looks like you might have built the system in the past with nix-build and forgot to remove that link. If you’re not using /root/result for anything, just remove it. After that there will be no roots left for lastpass-cli and you can delete it.

1 Like

thanks so much for the help!

funny stuff. I got rid of that symlink, which didn’t help me get back into lastpass-cli…

so after a little more futzing, I reinstalled my system yesterday…

and now everything is exactly back to how it was (thanks nixos)…

including the same errors from lastpass-cli

which indicate that I’m one version behind on lastpass-cli. and that has actually been the issue this whole time. hooray comedy! now I just have to figure out how to pin the newer version!