Open sestrella opened 1 month ago
Yeah, I've been looking into this a few times, see #792.
It's tricky to fix because we don't want to use impure
mode, but each invocation of import nixpkgs { .. }
should respect a global config.
Hi! I am trying to use the proposed workaround with NIXPKGS_ALLOW_UNFREE=1 use devenv
in the .envrc
and running NIXPKGS_ALLOW_UNFREE=1 devenv shell
in a devenv with terraform added as a language, but both approaches fail to resolve the "unfree license (‘bsl11’), refusing to evaluate" error. Can you please advise on why this might be? I would really love to use devenv.
I am on macos but use nixos-darwin for all installations if that is relevant.
You also need to enable impure: true
in devenv.yaml
.
Thank you for your helpful response, that was indeed the issue. It all works now!
Right now, it appears that setting
allowUnfree = true
only affects thenixpkgs
input; a closer look at the generated.devenv.flake.nix
file reveals the following code:So far, it appears that the only way to install "unfree" packages from external flakes is to pass them as
overlays
to the mainnixpkgs
input, which may be affected byallowUnfree = true
. A workaround I discovered is to prefix alldevenv
commands withNIXPKGS_ALLOW_UNFREE=1
or to add it directly to thedirenv
configuration file.envrc
, as shown below:To avoid this workaround, I am wondering if it makes sense to pass the
NIXPKGS_ALLOW_UNFREE=1
environment variable to allnix
commands invoked bydevenv
whenallowUnfree
is set totrue
. I'd be willing to submit a PR if the suggested change sounds like a viable solution for the mentioned scenario.