~/.nixpkgs/config.nix: global configurationAllow unfree software
Nix packages can be configured to allow or deny certain options.
To apply the configuration edit ~/.nixpkgs/config.nix
and set it like
{
allowUnfree = true;
}
and will allow the Nix package manager to install unfree licensed packages.
The configuration as listed also applies to NixOS under set.
Allow installing of packages that are distributed under unfree license by setting
allowUnfree = true;
or deny them by setting it to false.
Same can be achieved by setting the environment variable:
$ export NIXPKGS_ALLOW_UNFREE=1
Whenever unfree packages are not allowed, single packages can
still be allowed by a predicate function that accepts package
as an argument and should return a boolean:
allowUnfreePredicate = (pkg: ...);
Example to allow flash player only:
allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
Whenever unfree packages are not allowed, packages can still be
whitelisted by their license:
whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
In addition to whitelisting licenses which are denied by the
allowUnfree setting, you can also explicitely
deny installation of packages which have a certain license:
blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
A complete list of licenses can be found in the file
lib/licenses.nix of the nix package tree.
Overriding existing packages~/.nixpkgs/config.nix enables the user to
override package names without creating a fork of the Nixpkgs.
This is accomplished by defining a function called
packageOverrides. It takes the set of
packages, usually called pkgs, and returns a
modified set of packages.
Here is an example. Say we want to install
xbmc but we want to use another Python
version when running xbmc.
packageOverrides = pkgs: rec {
xbmc = pkgs.xbmc.override {
python = pkgs.python26;
};
};
Further information is available at the Nix
wiki