Keepass package won't go away?

Hi there! I’ve been using the ‘keepass’ package for quite some time. I defined this package in /etc/nixos/configuration.nix So recently I decided I’d try the ‘keepassxc’ package, so I replaced ‘keepass’ with ‘keepassxc’. It installed the KeePassXC package (works great btw) and I was happy. However, the ‘keepass’ package was not removed. It is still installed. I tried removing ‘keepassxc’ from /etc/nixos/configuration.nix and it was removed correctly, but ‘keepass’ is still there.

I’ve been executing ‘nixos-rebuild switch --upgrade’ each time I update the configuration. I’ve tried running ‘nix-collect-garbage’, and I’ve never used ‘nix-env -iA’, but I ran ‘nix-env e keepass’ just in case, but no luck. It just doesn’t want to leave! Any idea why this might be happening?

Thanks!

When you type which keepass, what do you get?

Oh right sorry! Whoops, I forgot to add that part. It seems odd to me as well:

So for my regular user, which keepass returns /nix/var/nix/profiles/default/bin/keepass. That /bin directory there only contains keepass and .keepass-wrapped.

The keepass file contains:

#! /nix/store/65l6hr8snf4v823f974k97jc65i7bhvf-bash-4.4-p12/bin/bash -e export LD_LIBRARY_PATH='/nix/store/n56mn6x861f8571ky3hwm57z14d3z65q-gtk+-2.24.31/lib'${LD_LIBRARY_PATH:+':'}$LD_LIBRARY_PATH exec -a "$0" "/nix/store/q00jnnqr47aaq5wib8yw9sw7vkkwycr2-keepass-2.37/bin/.keepass-wrapped" "${extraFlagsArray[@]}" "$@"

and the .keepass-wrapped file contains:

#! /nix/store/65l6hr8snf4v823f974k97jc65i7bhvf-bash-4.4-p12/bin/bash -e exec "/nix/store/cq6n625n6xsm3rvz0lnx4vdafwbj8cws-mono-4.0.4.1/bin/mono" "/nix/store/q00jnnqr47aaq5wib8yw9sw7vkkwycr2-keepass-2.37/lib/dotnet/keepass/KeePass.exe" "${extraFlagsArray[@]}" "$@"

That’s for my normal user. For root, which keepass gives me: /root/.nix-profile/bin/keepass. And it’s the same situation there. Only keepass and .keepass-wrapped are in that bin directory.

Is it safe to just delete that /bin/ directory if nothing else is there?

The default/ and .nix-profile/ directories both contain bin/ as well as lib/ share/, and manifest.nix

Thanks so much for your help!

You installed keepass into your root user’s profile.

sudo nix-env -e keepass

Note that by default the root user’s profile is also made available to all users. This way a multi-user install can install stuff globally with sudo.

1 Like

That was it! Thank you so much! And thank you for the clarification, it makes a lot of sense now. :slight_smile: