-
Notifications
You must be signed in to change notification settings - Fork 248
[remove nixpkgs] Remove CAPath, and only enable for nix >= 2.17 #1332
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
Conversation
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
Moving to draft. From testing this on devbox-cloud with nix 2.17, I see some errors that need fixing. |
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.
nice!
internal/nix/nix.go
Outdated
func Version() (string, error) { | ||
cmd := command("--version") | ||
outBytes, err := cmd.Output() | ||
if err != nil { | ||
return "", errors.WithStack(err) | ||
} | ||
out := string(outBytes) | ||
const prefix = "nix (Nix) " | ||
if !strings.HasPrefix(out, prefix) { | ||
return "", errors.Errorf(`Expected "%s" prefix, but output from nix --version was: %s`, prefix, out) | ||
} | ||
return strings.TrimSpace(strings.TrimPrefix(out, prefix)), nil | ||
} |
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.
Can we cache this output? In a package level variable is probably fine.
Summary
We want to restrict the feature to nix 2.17+, because it enables pure mode nix
when using just
fromPath
inbuiltins.fetchClosure
.This greatly simplifies the
devbox.lock
issues with caPath, and will improve the UX.This Remove Nixpkgs feature is most beneficial to new users who have not downloaded the nixpkgs they need. These users are most likely to have the latest nix installed for them, so I think restricting to nix >= 2.17 is an acceptable tradeoff.
How was it tested?
did a sanity test on x86-darwin.
need to test betteron a "supported system" where nix >= 2.17:examples/development/python/pip
, diddevbox shell
. Since we have system-info forpython
and notpip
, the generatedflake.nix
looked like this: