So there is nix.registry.name.flake which I like to quickly try out packages either from stable or unstable like this:
nix shell stable#coreutils
# or if I want the unstable package
nix shell unstable#coreutils
but if I try to download an unfree software (like discord), then I’m getting this:
error:
… while evaluating condition
at /nix/store/dgp9wmspgm6zhl66f0c81rvg3v7wwbsb-source/lib/customisation.nix:430:16:
429| drvPath =
430| assert condition;
| ^
431| drv.drvPath;
… while evaluating the attribute 'handled'
at /nix/store/dgp9wmspgm6zhl66f0c81rvg3v7wwbsb-source/pkgs/stdenv/generic/check-meta.nix:751:9:
750| # or, alternatively, just output a warning message.
751| handled = (
| ^
752| if valid == "yes" then
(stack trace truncated; use '--show-trace' to show the full trace)
error: Package ‘discord-0.0.116’ in /nix/store/dgp9wmspgm6zhl66f0c81rvg3v7wwbsb-source/pkgs/applications/networking/instant-messengers/discord/default.nix:71 has an unfree license (‘unfree’), 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) [
"discord"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.
How can I enable allowUnfree for my registries?