Skip to content

Conversation

@dtomvan
Copy link

@dtomvan dtomvan commented Jul 19, 2025

Because nix-env and nix3-profile cannot be used together, I added a check for ~/.local/state/nix/profiles/profile and if it exists, it will install the target package through nix profile install instead of nix-env -iA.

Things done

  • nix flake check
  • nix build
  • cargo clippy
  • Checked ./result/bin/comma -i josm works as intended on my system with a ~/.local/state/nix/profiles/profile.
  • Checked that before this patch ./result/bin/comma -i josm fails.

@DavHau
Copy link
Member

DavHau commented Jul 20, 2025

Should we even encourage people to use nix profile? Would it not be better to just remove this installation feature?

@dtomvan
Copy link
Author

dtomvan commented Jul 21, 2025

Should we even encourage people to use nix profile? Would it not be better to just remove this installation feature?

Well, nix profile is a supported feature in nix, and arguably much better than using nix-env for imperative package management. It has a good reason to exist, because it's the only way to allow a user that doesn't have sudo permissions to manage their own environment, without using home-manager. home-manager uses nix profile under the hood anyway:

$ nix profile list --json | jq '.elements["home-manager-path"]'
{
  "active": true,
  "priority": 5,
  "storePaths": [
    "/nix/store/cyij2blljr7bsjw72xnik8pcmk2z3rdw-home-manager-path"
  ]
}

Also, I think we all know why Nix exists and as such will put as much as possible inside of configs, but at the end of the day there are always these edge-cases where you want to install something semi-temporarily. I don't think supporting it with comma is "encouraging" it's use nessecarily...

Because `nix-env` and `nix3-profile` cannot be used together, I added
a check for `~/.local/state/nix/profiles/profile` and if it exists, it
will install the target package through `nix profile install` instead of
`nix-env -iA`.
@dtomvan dtomvan force-pushed the dtomvan/push-zlrysvztmuuw branch from 5555fb5 to a30773a Compare July 25, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants