nixpkgs global configuration
+~/.nixpkgs/config.nix: global configuration
- Nix packages can be configured to allow or deny certain
- options.
+ 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;
- }
-
+{
+ allowUnfree = true;
+}
and will allow the Nix package manager to install unfree licensed packages.
The configuration as listed also applies to NixOS under set.
@@ -26,16 +23,12 @@
Allow installing of packages that are distributed under unfree license by setting
-
- allowUnfree = true;
-
+ allowUnfree = true;
or deny them by setting it to false.
Same can be achieved by setting the environment variable:
-
- export NIXPKGS_ALLOW_UNFREE=1
-
+ $ export NIXPKGS_ALLOW_UNFREE=1
@@ -44,14 +37,10 @@
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: ...);
-
+ allowUnfreePredicate = (pkg: ...);
Example to allow flash player only:
-
- allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
-
+ allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
@@ -59,9 +48,7 @@
Whenever unfree packages are not allowed, packages can still be
whitelisted by their license:
-
- whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
-
+ whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
@@ -70,9 +57,7 @@
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 ];
-
+ blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
@@ -82,4 +67,4 @@
lib/licenses.nix of the nix package tree.
-
+
\ No newline at end of file