How do I flexibly specify which flake I want to remove from my profile?

I have installed a flake like so:

nix flake new hello -t templates#trivial
nix profile install ./hello

Now I would like to remove it from my profile in a human friendly way.

I first tried nix profile remove path:/tmp/lima/hello#defaultPackage.x86_64-linux.
The command succeeded but nix profile list shows that package is still installed:

2 path:/tmp/lima/hello#defaultPackage.x86_64-linux path:/tmp/lima/hello?narHash=sha256-XiJ8I%2fGPKUiEprOje51VBpuP6ZkxUHPgCrCRatDdV1k=#defaultPackage.x86_64-linux /nix/store/ssccr9khjprx3722cqcjikngzffjl4xf-hello-2.10

I then tried what I understand is meant by attribute path:

nix profile remove packages.hello.defaultPackage.x86_64-linux

That also did not work. I also don’t fully grasp what “attribute path” means here. :confused:

After some fiddling, I found I can reliably remove it by running:

  • nix profile remove 2
  • nix profile remove /nix/store/ssccr9khjprx3722cqcjikngzffjl4xf-hello-2.10

So what attribute path must I specify to remove this flake?

3 Likes

I also don’t know how to delete it.
I’m having a headache with nix issues these days.

1 Like