Despite that, it still conflict whenever I use obsidian and slack package.
building Nix...
building the system configuration...
error: Package āobsidian-0.14.15ā in /nix/store/xxxxxxxx-unstable/unstable/pkgs/applications/misc/obsidian/default.nix:18 has an unfree license (āobsidianā), 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: 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) [
"obsidian"
];
}
c) 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)
Iām trying to builtins.trace in the config entry, but nothing traced (like not called at all).
I want to report this as a bug but need someone that might points out a mis-configuration.
The nixpkgs.* options are configuring pkgs, but you didnāt pull the packages from pkgs. Try upkg = import <unstable> { config.allowUnfreePredicate = ...; };
This situation where 1. setting allowUnfree* in a module does nothing by itself and 2. setting allowUnfree* when importing Nixpkgs does not work unless you also set it in a module, is fairly recent and pretty weird actually.
I think there are a couple of GH issues about this that apparently nobody knows what to do about.