Error: Package ‘nvidia-x11'

error: Package ‘nvidia-x11-570.144-6.12.28’

error
error:
       … while calling the 'head' builtin
         at /nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while evaluating the attribute 'value'
         at /nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/lib/modules.nix:1084:7:
         1083|     // {
         1084|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1085|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build.toplevel':

       … while evaluating definitions from `/nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `warnings':

       … while evaluating definitions from `/nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/nixos/modules/system/boot/systemd/tmpfiles.nix':

       … while evaluating the option `systemd.tmpfiles.settings.graphics-driver."/run/opengl-driver"."L+".argument':

       … while evaluating definitions from `/nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/nixos/modules/hardware/graphics.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: Package ‘nvidia-x11-570.144-6.12.28’ in /nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/pkgs/os-specific/linux/nvidia-x11/generic.nix:320 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

       a) To temporarily allow unfree packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNFREE=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnfree = true; }
       in configuration.nix to override this.

       Alternatively you can configure a predicate to allow specific packages:
         { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
             "nvidia-x11"
           ];
         }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnfree = true; }
       to ~/.config/nixpkgs/config.nix.

The error message tells you what to do:

2 Likes