You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Print error message if --arg is used with a flake #3949
When you try to build something unfree, you get a message like this:
$ nix build nixpkgs#cudatoolkit
error: --- ThrownError --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
Package ‘cudatoolkit-10.2.89’ in /nix/store/9xsn9g209bvbl324kska98xzsnr4ls95-source/pkgs/development/compilers/cudatoolkit/common.nix:214 has an unfree license (‘unfree’), refusing to evaluate.
a) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.
b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
cached failure of attribute 'legacyPackages.x86_64-linux.cudatoolkit.drvPath'
I think we may need to rethink how args work w.r.t. flakes. It's unclear whether "arg" applies to the flake itself, or to the flake + attr path. In addition, there's a few things that we could fix in the new command line that have existed previously in nix-build:
Nix doesn't error when the arg doesn't actually exist.
Nested attribute names like --arg config.allowUnfree false don't work.
Activity
edolstra commentedon Aug 24, 2020
The reason for not supporting arguments in flakes is discussed here: #3843 (comment)
matthewbauer commentedon Aug 24, 2020
Maybe
--argshould be an error on flakes then?[-]"args" not being passed to flakes properly[/-][+]Print error message if --arg is used with a flake[/+]