Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Move all nixpkgs doc files in to the doc directory

This makes a makefile-driven developer workflow nicer.

(cherry picked from commit 92d53362d4da7e19b6a7a6b1b936a0a34a17c0c9)

Edited to remove the emscripten references, which were new on
master

+239 -237
+18 -18
doc/default.nix
··· 45 cp -s '${sources-langs}'/* ./languages-frameworks 46 '' 47 + toDocbook { 48 - inputFile = ./introduction.md; 49 - outputFile = "introduction.xml"; 50 useChapters = true; 51 } 52 + toDocbook { 53 - inputFile = ./shell.md; 54 - outputFile = "shell.xml"; 55 } 56 + toDocbook { 57 - inputFile = ./languages-frameworks/python.md; 58 - outputFile = "./languages-frameworks/python.xml"; 59 } 60 + toDocbook { 61 - inputFile = ./languages-frameworks/haskell.md; 62 - outputFile = "./languages-frameworks/haskell.xml"; 63 } 64 + toDocbook { 65 - inputFile = ../pkgs/development/idris-modules/README.md; 66 - outputFile = "languages-frameworks/idris.xml"; 67 } 68 + toDocbook { 69 - inputFile = ../pkgs/development/node-packages/README.md; 70 - outputFile = "languages-frameworks/node.xml"; 71 } 72 + toDocbook { 73 - inputFile = ../pkgs/development/r-modules/README.md; 74 - outputFile = "languages-frameworks/r.xml"; 75 } 76 + toDocbook { 77 - inputFile = ./languages-frameworks/rust.md; 78 - outputFile = "./languages-frameworks/rust.xml"; 79 } 80 + toDocbook { 81 - inputFile = ./languages-frameworks/vim.md; 82 - outputFile = "./languages-frameworks/vim.xml"; 83 } 84 + '' 85 echo ${lib.nixpkgsVersion} > .version
··· 45 cp -s '${sources-langs}'/* ./languages-frameworks 46 '' 47 + toDocbook { 48 + inputFile = ./introduction.chapter.md; 49 + outputFile = "introduction.chapter.xml"; 50 useChapters = true; 51 } 52 + toDocbook { 53 + inputFile = ./shell.section.md; 54 + outputFile = "shell.section.xml"; 55 } 56 + toDocbook { 57 + inputFile = ./languages-frameworks/python.section.md; 58 + outputFile = "./languages-frameworks/python.section.xml"; 59 } 60 + toDocbook { 61 + inputFile = ./languages-frameworks/haskell.section.md; 62 + outputFile = "./languages-frameworks/haskell.section.xml"; 63 } 64 + toDocbook { 65 + inputFile = ./languages-frameworks/idris.section.md; 66 + outputFile = "languages-frameworks/idris.section.xml"; 67 } 68 + toDocbook { 69 + inputFile = ./languages-frameworks/node.section.md; 70 + outputFile = "languages-frameworks/node.section.xml"; 71 } 72 + toDocbook { 73 + inputFile = ./languages-frameworks/r.section.md; 74 + outputFile = "languages-frameworks/r.section.xml"; 75 } 76 + toDocbook { 77 + inputFile = ./languages-frameworks/rust.section.md; 78 + outputFile = "./languages-frameworks/rust.section.xml"; 79 } 80 + toDocbook { 81 + inputFile = ./languages-frameworks/vim.section.md; 82 + outputFile = "./languages-frameworks/vim.section.xml"; 83 } 84 + '' 85 echo ${lib.nixpkgsVersion} > .version
doc/introduction.md doc/introduction.chapter.md
doc/languages-frameworks/haskell.md doc/languages-frameworks/haskell.section.md
+39
doc/languages-frameworks/idris.section.md
···
··· 1 + Idris packages 2 + ============== 3 + 4 + This directory contains build rules for idris packages. In addition, 5 + it contains several functions to build and compose those packages. 6 + Everything is exposed to the user via the `idrisPackages` attribute. 7 + 8 + callPackage 9 + ------------ 10 + 11 + This is like the normal nixpkgs callPackage function, specialized to 12 + idris packages. 13 + 14 + builtins 15 + --------- 16 + 17 + This is a list of all of the libraries that come packaged with Idris 18 + itself. 19 + 20 + build-idris-package 21 + -------------------- 22 + 23 + A function to build an idris package. Its sole argument is a set like 24 + you might pass to `stdenv.mkDerivation`, except `build-idris-package` 25 + sets several attributes for you. See `build-idris-package.nix` for 26 + details. 27 + 28 + build-builtin-package 29 + ---------------------- 30 + 31 + A version of `build-idris-package` specialized to builtin libraries. 32 + Mostly for internal use. 33 + 34 + with-packages 35 + ------------- 36 + 37 + Bundle idris together with a list of packages. Because idris currently 38 + only supports a single directory in its library path, you must include 39 + all desired libraries here, including `prelude` and `base`.
+7 -8
doc/languages-frameworks/index.xml
··· 17 <xi:include href="bower.xml" /> 18 <xi:include href="coq.xml" /> 19 <xi:include href="go.xml" /> 20 - <xi:include href="haskell.xml" /> 21 - <xi:include href="idris.xml" /> <!-- generated from ../../pkgs/development/idris-modules/README.md --> 22 <xi:include href="java.xml" /> 23 <xi:include href="lua.xml" /> 24 - <xi:include href="node.xml" /> <!-- generated from ../../pkgs/development/node-packages/README.md --> 25 <xi:include href="perl.xml" /> 26 - <xi:include href="python.xml" /> 27 <xi:include href="qt.xml" /> 28 - <xi:include href="r.xml" /> <!-- generated from ../../pkgs/development/r-modules/README.md --> 29 <xi:include href="ruby.xml" /> 30 - <xi:include href="rust.xml" /> 31 <xi:include href="texlive.xml" /> 32 - <xi:include href="vim.xml" /> 33 - 34 35 </chapter>
··· 17 <xi:include href="bower.xml" /> 18 <xi:include href="coq.xml" /> 19 <xi:include href="go.xml" /> 20 + <xi:include href="haskell.section.xml" /> 21 + <xi:include href="idris.section.xml" /> 22 <xi:include href="java.xml" /> 23 <xi:include href="lua.xml" /> 24 + <xi:include href="node.section.xml" /> 25 <xi:include href="perl.xml" /> 26 + <xi:include href="python.section.xml" /> 27 <xi:include href="qt.xml" /> 28 + <xi:include href="r.section.xml" /> 29 <xi:include href="ruby.xml" /> 30 + <xi:include href="rust.section.xml" /> 31 <xi:include href="texlive.xml" /> 32 + <xi:include href="vim.section.xml" /> 33 34 </chapter>
+51
doc/languages-frameworks/node.section.md
···
··· 1 + Node.js packages 2 + ================ 3 + The `pkgs/development/node-packages` folder contains a generated collection of 4 + [NPM packages](https://npmjs.com/) that can be installed with the Nix package 5 + manager. 6 + 7 + As a rule of thumb, the package set should only provide *end user* software 8 + packages, such as command-line utilities. Libraries should only be added to the 9 + package set if there is a non-NPM package that requires it. 10 + 11 + When it is desired to use NPM libraries in a development project, use the 12 + `node2nix` generator directly on the `package.json` configuration file of the 13 + project. 14 + 15 + The package set also provides support for multiple Node.js versions. The policy 16 + is that a new package should be added to the collection for the latest stable LTS 17 + release (which is currently 6.x), unless there is an explicit reason to support 18 + a different release. 19 + 20 + If your package uses native addons, you need to examine what kind of native 21 + build system it uses. Here are some examples: 22 + 23 + * `node-gyp` 24 + * `node-gyp-builder` 25 + * `node-pre-gyp` 26 + 27 + After you have identified the correct system, you need to override your package 28 + expression while adding in build system as a build input. For example, `dat` 29 + requires `node-gyp-build`, so we override its expression in `default-v6.nix`: 30 + 31 + ```nix 32 + dat = nodePackages.dat.override (oldAttrs: { 33 + buildInputs = oldAttrs.buildInputs ++ [ nodePackages.node-gyp-build ]; 34 + }); 35 + ``` 36 + 37 + To add a package from NPM to nixpkgs: 38 + 39 + 1. Modify `pkgs/development/node-packages/node-packages-v6.json` to add, update 40 + or remove package entries. (Or `pkgs/development/node-packages/node-packages-v4.json` 41 + for packages depending on Node.js 4.x) 42 + 2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`. 43 + 3. Build your new package to test your changes: 44 + `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`. 45 + To build against a specific Node.js version (e.g. 4.x): 46 + `nix-build -A nodePackages_4_x.<new-or-updated-package>` 47 + 4. Add and commit all modified and generated files. 48 + 49 + For more information about the generation process, consult the 50 + [README.md](https://github.com/svanderburg/node2nix) file of the `node2nix` 51 + tool.
doc/languages-frameworks/python.md doc/languages-frameworks/python.section.md
+120
doc/languages-frameworks/r.section.md
···
··· 1 + R packages 2 + ========== 3 + 4 + ## Installation 5 + 6 + Define an environment for R that contains all the libraries that you'd like to 7 + use by adding the following snippet to your $HOME/.config/nixpkgs/config.nix file: 8 + 9 + ```nix 10 + { 11 + packageOverrides = super: let self = super.pkgs; in 12 + { 13 + 14 + rEnv = super.rWrapper.override { 15 + packages = with self.rPackages; [ 16 + devtools 17 + ggplot2 18 + reshape2 19 + yaml 20 + optparse 21 + ]; 22 + }; 23 + }; 24 + } 25 + ``` 26 + 27 + Then you can use `nix-env -f "<nixpkgs>" -iA rEnv` to install it into your user 28 + profile. The set of available libraries can be discovered by running the 29 + command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that 30 + output is the name that has to be passed to rWrapper in the code snipped above. 31 + 32 + However, if you'd like to add a file to your project source to make the 33 + environment available for other contributors, you can create a `default.nix` 34 + file like so: 35 + ```nix 36 + let 37 + pkgs = import <nixpkgs> {}; 38 + stdenv = pkgs.stdenv; 39 + in with pkgs; { 40 + myProject = stdenv.mkDerivation { 41 + name = "myProject"; 42 + version = "1"; 43 + src = if pkgs.lib.inNixShell then null else nix; 44 + 45 + buildInputs = with rPackages; [ 46 + R 47 + ggplot2 48 + knitr 49 + ]; 50 + }; 51 + } 52 + ``` 53 + and then run `nix-shell .` to be dropped into a shell with those packages 54 + available. 55 + 56 + ## RStudio 57 + 58 + RStudio uses a standard set of packages and ignores any custom R 59 + environments or installed packages you may have. To create a custom 60 + environment, see `rstudioWrapper`, which functions similarly to 61 + `rWrapper`: 62 + 63 + ```nix 64 + { 65 + packageOverrides = super: let self = super.pkgs; in 66 + { 67 + 68 + rstudioEnv = super.rstudioWrapper.override { 69 + packages = with self.rPackages; [ 70 + dplyr 71 + ggplot2 72 + reshape2 73 + ]; 74 + }; 75 + }; 76 + } 77 + ``` 78 + 79 + Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install 80 + this into your user profile. 81 + 82 + Alternatively, you can create a self-contained `shell.nix` without the need to 83 + modify any configuration files: 84 + 85 + ```nix 86 + { pkgs ? import <nixpkgs> {} 87 + }: 88 + 89 + pkgs.rstudioWrapper.override { 90 + packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ]; 91 + } 92 + 93 + ``` 94 + 95 + Executing `nix-shell` will then drop you into an environment equivalent to the 96 + one above. If you need additional packages just add them to the list and 97 + re-enter the shell. 98 + 99 + ## Updating the package set 100 + 101 + ```bash 102 + nix-shell generate-shell.nix 103 + 104 + Rscript generate-r-packages.R cran > cran-packages.nix.new 105 + mv cran-packages.nix.new cran-packages.nix 106 + 107 + Rscript generate-r-packages.R bioc > bioc-packages.nix.new 108 + mv bioc-packages.nix.new bioc-packages.nix 109 + ``` 110 + 111 + `generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefor the renaming. 112 + 113 + 114 + ## Testing if the Nix-expression could be evaluated 115 + 116 + ```bash 117 + nix-build test-evaluation.nix --dry-run 118 + ``` 119 + 120 + If this exits fine, the expression is ok. If not, you have to edit `default.nix`
doc/languages-frameworks/rust.md doc/languages-frameworks/rust.section.md
doc/languages-frameworks/vim.md doc/languages-frameworks/vim.section.md
+1 -1
doc/manual.xml
··· 9 10 </info> 11 12 - <xi:include href="introduction.xml" /> 13 <xi:include href="quick-start.xml" /> 14 <xi:include href="stdenv.xml" /> 15 <xi:include href="multiple-output.xml" />
··· 9 10 </info> 11 12 + <xi:include href="introduction.chapter.xml" /> 13 <xi:include href="quick-start.xml" /> 14 <xi:include href="stdenv.xml" /> 15 <xi:include href="multiple-output.xml" />
doc/shell.md doc/shell.section.md
+1 -39
pkgs/development/idris-modules/README.md
··· 1 - Idris packages 2 - ============== 3 - 4 - This directory contains build rules for idris packages. In addition, 5 - it contains several functions to build and compose those packages. 6 - Everything is exposed to the user via the `idrisPackages` attribute. 7 - 8 - callPackage 9 - ------------ 10 - 11 - This is like the normal nixpkgs callPackage function, specialized to 12 - idris packages. 13 - 14 - builtins 15 - --------- 16 - 17 - This is a list of all of the libraries that come packaged with Idris 18 - itself. 19 - 20 - build-idris-package 21 - -------------------- 22 - 23 - A function to build an idris package. Its sole argument is a set like 24 - you might pass to `stdenv.mkDerivation`, except `build-idris-package` 25 - sets several attributes for you. See `build-idris-package.nix` for 26 - details. 27 - 28 - build-builtin-package 29 - ---------------------- 30 - 31 - A version of `build-idris-package` specialized to builtin libraries. 32 - Mostly for internal use. 33 - 34 - with-packages 35 - ------------- 36 - 37 - Bundle idris together with a list of packages. Because idris currently 38 - only supports a single directory in its library path, you must include 39 - all desired libraries here, including `prelude` and `base`.
··· 1 + Moved to [/doc/languages-frameworks/idris.section.md](/doc/languages-frameworks/idris.section.md)
+1 -51
pkgs/development/node-packages/README.md
··· 1 - Node.js packages 2 - ================ 3 - The `pkgs/development/node-packages` folder contains a generated collection of 4 - [NPM packages](https://npmjs.com/) that can be installed with the Nix package 5 - manager. 6 - 7 - As a rule of thumb, the package set should only provide *end user* software 8 - packages, such as command-line utilities. Libraries should only be added to the 9 - package set if there is a non-NPM package that requires it. 10 - 11 - When it is desired to use NPM libraries in a development project, use the 12 - `node2nix` generator directly on the `package.json` configuration file of the 13 - project. 14 - 15 - The package set also provides support for multiple Node.js versions. The policy 16 - is that a new package should be added to the collection for the latest stable LTS 17 - release (which is currently 6.x), unless there is an explicit reason to support 18 - a different release. 19 - 20 - If your package uses native addons, you need to examine what kind of native 21 - build system it uses. Here are some examples: 22 - 23 - * `node-gyp` 24 - * `node-gyp-builder` 25 - * `node-pre-gyp` 26 - 27 - After you have identified the correct system, you need to override your package 28 - expression while adding in build system as a build input. For example, `dat` 29 - requires `node-gyp-build`, so we override its expression in `default-v6.nix`: 30 - 31 - ```nix 32 - dat = nodePackages.dat.override (oldAttrs: { 33 - buildInputs = oldAttrs.buildInputs ++ [ nodePackages.node-gyp-build ]; 34 - }); 35 - ``` 36 - 37 - To add a package from NPM to nixpkgs: 38 - 39 - 1. Modify `pkgs/development/node-packages/node-packages-v6.json` to add, update 40 - or remove package entries. (Or `pkgs/development/node-packages/node-packages-v4.json` 41 - for packages depending on Node.js 4.x) 42 - 2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`. 43 - 3. Build your new package to test your changes: 44 - `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`. 45 - To build against a specific Node.js version (e.g. 4.x): 46 - `nix-build -A nodePackages_4_x.<new-or-updated-package>` 47 - 4. Add and commit all modified and generated files. 48 - 49 - For more information about the generation process, consult the 50 - [README.md](https://github.com/svanderburg/node2nix) file of the `node2nix` 51 - tool.
··· 1 + Moved to [/doc/languages-frameworks/node.section.md](/doc/languages-frameworks/node.section.md)
+1 -120
pkgs/development/r-modules/README.md
··· 1 - R packages 2 - ========== 3 - 4 - ## Installation 5 - 6 - Define an environment for R that contains all the libraries that you'd like to 7 - use by adding the following snippet to your $HOME/.config/nixpkgs/config.nix file: 8 - 9 - ```nix 10 - { 11 - packageOverrides = super: let self = super.pkgs; in 12 - { 13 - 14 - rEnv = super.rWrapper.override { 15 - packages = with self.rPackages; [ 16 - devtools 17 - ggplot2 18 - reshape2 19 - yaml 20 - optparse 21 - ]; 22 - }; 23 - }; 24 - } 25 - ``` 26 - 27 - Then you can use `nix-env -f "<nixpkgs>" -iA rEnv` to install it into your user 28 - profile. The set of available libraries can be discovered by running the 29 - command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that 30 - output is the name that has to be passed to rWrapper in the code snipped above. 31 - 32 - However, if you'd like to add a file to your project source to make the 33 - environment available for other contributors, you can create a `default.nix` 34 - file like so: 35 - ```nix 36 - let 37 - pkgs = import <nixpkgs> {}; 38 - stdenv = pkgs.stdenv; 39 - in with pkgs; { 40 - myProject = stdenv.mkDerivation { 41 - name = "myProject"; 42 - version = "1"; 43 - src = if pkgs.lib.inNixShell then null else nix; 44 - 45 - buildInputs = with rPackages; [ 46 - R 47 - ggplot2 48 - knitr 49 - ]; 50 - }; 51 - } 52 - ``` 53 - and then run `nix-shell .` to be dropped into a shell with those packages 54 - available. 55 - 56 - ## RStudio 57 - 58 - RStudio uses a standard set of packages and ignores any custom R 59 - environments or installed packages you may have. To create a custom 60 - environment, see `rstudioWrapper`, which functions similarly to 61 - `rWrapper`: 62 - 63 - ```nix 64 - { 65 - packageOverrides = super: let self = super.pkgs; in 66 - { 67 - 68 - rstudioEnv = super.rstudioWrapper.override { 69 - packages = with self.rPackages; [ 70 - dplyr 71 - ggplot2 72 - reshape2 73 - ]; 74 - }; 75 - }; 76 - } 77 - ``` 78 - 79 - Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install 80 - this into your user profile. 81 - 82 - Alternatively, you can create a self-contained `shell.nix` without the need to 83 - modify any configuration files: 84 - 85 - ```nix 86 - { pkgs ? import <nixpkgs> {} 87 - }: 88 - 89 - pkgs.rstudioWrapper.override { 90 - packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ]; 91 - } 92 - 93 - ``` 94 - 95 - Executing `nix-shell` will then drop you into an environment equivalent to the 96 - one above. If you need additional packages just add them to the list and 97 - re-enter the shell. 98 - 99 - ## Updating the package set 100 - 101 - ```bash 102 - nix-shell generate-shell.nix 103 - 104 - Rscript generate-r-packages.R cran > cran-packages.nix.new 105 - mv cran-packages.nix.new cran-packages.nix 106 - 107 - Rscript generate-r-packages.R bioc > bioc-packages.nix.new 108 - mv bioc-packages.nix.new bioc-packages.nix 109 - ``` 110 - 111 - `generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefor the renaming. 112 - 113 - 114 - ## Testing if the Nix-expression could be evaluated 115 - 116 - ```bash 117 - nix-build test-evaluation.nix --dry-run 118 - ``` 119 - 120 - If this exits fine, the expression is ok. If not, you have to edit `default.nix`
··· 1 + Moved to [/doc/languages-frameworks/r.section.md](/doc/languages-frameworks/r.section.md)