DeterminateSystems/zero-to-nix

Allow unfree?

DanLipsitt opened this issue · 0 comments

How do I enable unfree packages? When attempting to run one with nix shell, I get the following error:

       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: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       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) [
             "vscode"
           ];
         }

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

a) doesn't apply because I want the setting to persist. b) doesn't apply because I'm on Darwin, not NixOS. c) doesn't work. ~/.config/nixpkgs/config.nix doesn't exist, and creating it with the suggested contents doesn't appear to do anything. I'm using Home Manager but it doesn't appear to have its own setting for this.

In the future, could this be configured based on a prompt from the Determinate installer?