-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nix run
pure unfree packages
#9875
Comments
That's quite a bummer, I agree. A dedicated flag would be quite ad-hoc and a nasty layer violation (Nix doesn't know about free/unfree things, that's just something encoded in Nixpkgs), but we should find a replacement for that. Maybe that could be solved on the Nixpkgs side by providing an |
A command-line parameter to pass arguments when importing a flake wouldn't break the command-level purity and would be rather similar to one of the purer ways of achieving it with the previous CLI. (And, as you say, would not do anything that a dependent flake couldn't cause from the caching point of view) |
What about adding a CLI arg for injecting env variables into a pure environment? It should be ok from a sandboxing perspective because it's explicitly specified, rather than inheriting the variables from the host, so I don't see what issues it could cause. Then the solution would just be something like
|
This is similar to #5663 and related issues. A workaround is to use https://github.com/numtide/nixpkgs-unfree. Or to craft your own that specifies a license policy that you want. So while this can be solved by using your own flake, this is a feature that used to exist, but led to problems resulting in the creation of the pure-evaluation mode. If we want something that makes this easier and built into upstream, one can imagine adding a "config" input to the nixpkgs flake, empty by default allowing something like I don't think we've considered adding env var injection. As opposed to making it an explicit input, this would break things like the eval cache if not tracked. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-02-16-nix-team-meeting-minutes-124/39870/1 |
Possibly related: #5567 Maybe it would be nice to inject things like
or even
within the command line |
Having it behave the same for How about making these configuration options part of the flake uri? We already allow some query parameters for some sources, but it could support config options as well.
It would work for package uris as well:
The referred flake would get
nixpkgs would need to support this. |
There appears to be no way to run unfree packages in a pure nix run/shell.
The only workaround seems to be
NIXPKGS_ALLOW_UNFREE=1 nix run --impure <pkg>
, but that doesn't allow for a pure shell.I understand that nix3 attempts to provide as much isolation as possible, hence it not reading any system-wide configuration (e.g.
{ allowUnfree = true; }
in my~/.config/nixpkgs/config.nix.
).However, it would be nice to at least have a CLI flag, e.g.
--allow-unfree
onnix run
andnix shell
to bypass the check.The text was updated successfully, but these errors were encountered: