-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap up nix-env in a way that handles conflicting, pre-installed packages #1467
Wrap up nix-env in a way that handles conflicting, pre-installed packages #1467
Conversation
src/nixenv.rs
Outdated
{ | ||
let output = tokio::process::Command::new(self.nix_store_path.join("bin/nix-env")) | ||
.process_group(0) | ||
.arg("--profile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be problematic for any time we operate on profiles that may have been touched by the nix profile
command:
$ nix-env --query --installed --out-path --json
error: profile '/home/vin/.local/state/nix/profiles/profile' is incompatible with 'nix-env'; please use 'nix profile' instead
(but we already have this problem, so maybe-fine to not deal with it now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After that error change, seems fine to me
Description
If an installed package contains programs or paths named like
nix
,nix-env -i
will fail due to the conflict.Instead of a naive
nix-env -i
, this PR:Note that another approach could be to set the conflicting packages to a lower priority (higher numerical value.) However, that still requires most of the code here, and has the down side that it is dealing with more complexity of nix-env. The approach here -- while ... verbose ... should work in all cases.
Checklist
cargo fmt
nix build
nix flake check
Validating with
install.determinate.systems
If a maintainer has added the
upload to s3
label to this PR, it will become available for installation viainstall.determinate.systems
: