diff options
author | Domen Kožar <domen@dev.si> | 2015-04-24 11:20:41 +0200 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-04-24 11:20:41 +0200 |
commit | 69777a7cb48eddc21363f40372c4c87a12a7ddf3 (patch) | |
tree | cb422da5692879fdb69057c4d82985f93865753e | |
parent | 3428b8df5766f01aee8538fb3e501cde0fa6c007 (diff) | |
parent | 018062529aca9b83a6b03db163d121a8bd25ce01 (diff) | |
download | nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.tar nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.tar.gz nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.tar.bz2 nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.tar.lz nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.tar.xz nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.tar.zst nixlib-69777a7cb48eddc21363f40372c4c87a12a7ddf3.zip |
Merge pull request #7484 from seppeljordan/re#4505
Document about packageOverrides (re issue #4505)
-rw-r--r-- | doc/packageconfig.xml | 107 |
1 files changed, 62 insertions, 45 deletions
diff --git a/doc/packageconfig.xml b/doc/packageconfig.xml index b5e57df71ffc..44ce1974c6cf 100644 --- a/doc/packageconfig.xml +++ b/doc/packageconfig.xml @@ -1,6 +1,6 @@ <chapter xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xml:id="chap-packageconfig"> + xmlns:xlink="http://www.w3.org/1999/xlink" + xml:id="chap-packageconfig"> <title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title> @@ -9,62 +9,79 @@ </para> <para> - To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename> - and set it like + To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename> + and set it like <programlisting>{ allowUnfree = true; }</programlisting> - and will allow the Nix package manager to install unfree licensed packages. + and will allow the Nix package manager to install unfree licensed packages. - The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set. + The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set. </para> <itemizedlist> - <listitem> - <para> - Allow installing of packages that are distributed under unfree license by setting - <programlisting>allowUnfree = true;</programlisting> - or deny them by setting it to <literal>false</literal>. - </para> - <para> - Same can be achieved by setting the environment variable: - <programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting> - </para> - </listitem> + <listitem> + <para> + Allow installing of packages that are distributed under unfree license by setting + <programlisting>allowUnfree = true;</programlisting> + or deny them by setting it to <literal>false</literal>. + </para> + <para> + Same can be achieved by setting the environment variable: + <programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting> + </para> + </listitem> - <listitem> - <para> - 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: - <programlisting>allowUnfreePredicate = (pkg: ...);</programlisting> + <listitem> + <para> + 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: + <programlisting>allowUnfreePredicate = (pkg: ...);</programlisting> - Example to allow flash player only: - <programlisting>allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);</programlisting> - </para> - </listitem> + Example to allow flash player only: + <programlisting>allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);</programlisting> + </para> + </listitem> - <listitem> - <para> - Whenever unfree packages are not allowed, packages can still be - whitelisted by their license: - <programlisting>whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];</programlisting> - </para> - </listitem> + <listitem> + <para> + Whenever unfree packages are not allowed, packages can still be + whitelisted by their license: + <programlisting>whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];</programlisting> + </para> + </listitem> - <listitem> - <para> - In addition to whitelisting licenses which are denied by the - <literal>allowUnfree</literal> setting, you can also explicitely - deny installation of packages which have a certain license: - <programlisting>blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];</programlisting> - </para> - </listitem> + <listitem> + <para> + In addition to whitelisting licenses which are denied by the + <literal>allowUnfree</literal> setting, you can also explicitely + deny installation of packages which have a certain license: + <programlisting>blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];</programlisting> + </para> + </listitem> </itemizedlist> <para> - A complete list of licenses can be found in the file - <filename>lib/licenses.nix</filename> of the nix package tree. + A complete list of licenses can be found in the file + <filename>lib/licenses.nix</filename> of the nix package tree. </para> -</chapter> \ No newline at end of file +<section><title>Modify packages via <literal>packageOverrides</literal></title> + +<para> + + You can define a function called <varname>packageOverrides</varname> + in your local <filename>~/.nixpkgs/config</filename> to overide nix + packages. It must be a function that takes pkgs as an argument and + return modified set of packages. + + <programlisting>{ + packageOverrides = pkgs: rec { + foo = pkgs.foo.override { ... }; + }; +}</programlisting> +</para> +</section> + +</chapter> |