Hello,
I face an issue I don’t get.
in my config.nix file, I have
nixpkgs = {
config = {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"corefonts"
];
};
};
fonts.packages = with pkgs; [
corefonts
];
but when I do sudo nixos-rebuild switch --show-trace --flake .#thatoo
, I get this error :
error: Package ‘corefonts-1’ in /nix/store/f30jn7l0bf7a01qj029fq55i466vmnkh-source/pkgs/by-name/co/corefonts/package.nix:142 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) [
"corefonts"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.
even though I feel I’m doing the solution b) already. That’s why i don’t get how to solve my issue.
What should I do?