Merge pull request #145103 from symphorien/nix-env-i

doc: minimize mentions of nix-env -i without -A in nixpkgs manual

authored by Domen Kožar and committed by GitHub 4b1c74a7 74a2ea49

+14 -29
+1 -1
doc/builders/packages/linux.section.md
··· 29 4. If needed you can also run `make menuconfig`: 30 31 ```ShellSession 32 - $ nix-env -i ncurses 33 $ export NIX_CFLAGS_LINK=-lncurses 34 $ make menuconfig ARCH=arch 35 ```
··· 29 4. If needed you can also run `make menuconfig`: 30 31 ```ShellSession 32 + $ nix-env -f "<nixpkgs>" -iA ncurses 33 $ export NIX_CFLAGS_LINK=-lncurses 34 $ make menuconfig ARCH=arch 35 ```
+4 -4
doc/contributing/submitting-changes.chapter.md
··· 43 - nixpkgs: 44 45 - update pkg 46 - - `nix-env -i pkg-name -f <path to your local nixpkgs folder>` 47 - add pkg 48 - Make sure it’s in `pkgs/top-level/all-packages.nix` 49 - - `nix-env -i pkg-name -f <path to your local nixpkgs folder>` 50 - _If you don’t want to install pkg in you profile_. 51 - - `nix-build -A pkg-attribute-name <path to your local nixpkgs folder>/default.nix` and check results in the folder `result`. It will appear in the same directory where you did `nix-build`. 52 - - If you did `nix-env -i pkg-name` you can do `nix-env -e pkg-name` to uninstall it from your system. 53 54 - NixOS and its modules: 55 - You can add new module to your NixOS configuration file (usually it’s `/etc/nixos/configuration.nix`). And do `sudo nixos-rebuild test -I nixpkgs=<path to your local nixpkgs folder> --fast`.
··· 43 - nixpkgs: 44 45 - update pkg 46 + - `nix-env -iA pkg-attribute-name -f <path to your local nixpkgs folder>` 47 - add pkg 48 - Make sure it’s in `pkgs/top-level/all-packages.nix` 49 + - `nix-env -iA pkg-attribute-name -f <path to your local nixpkgs folder>` 50 - _If you don’t want to install pkg in you profile_. 51 + - `nix-build -A pkg-attribute-name <path to your local nixpkgs folder>` and check results in the folder `result`. It will appear in the same directory where you did `nix-build`. 52 + - If you installed your package with `nix-env`, you can run `nix-env -e pkg-name` where `pkg-name` is as reported by `nix-env -q` to uninstall it from your system. 53 54 - NixOS and its modules: 55 - You can add new module to your NixOS configuration file (usually it’s `/etc/nixos/configuration.nix`). And do `sudo nixos-rebuild test -I nixpkgs=<path to your local nixpkgs folder> --fast`.
+2 -2
doc/languages-frameworks/emscripten.section.md
··· 15 16 If you want to work with `emcc`, `emconfigure` and `emmake` as you are used to from Ubuntu and similar distributions you can use these commands: 17 18 - * `nix-env -i emscripten` 19 * `nix-shell -p emscripten` 20 21 * **Declarative usage**: 22 23 - This mode is far more power full since this makes use of `nix` for dependency management of emscripten libraries and targets by using the `mkDerivation` which is implemented by `pkgs.emscriptenStdenv` and `pkgs.buildEmscriptenPackage`. The source for the packages is in `pkgs/top-level/emscripten-packages.nix` and the abstraction behind it in `pkgs/development/em-modules/generic/default.nix`. 24 * build and install all packages: 25 * `nix-env -iA emscriptenPackages` 26
··· 15 16 If you want to work with `emcc`, `emconfigure` and `emmake` as you are used to from Ubuntu and similar distributions you can use these commands: 17 18 + * `nix-env -f "<nixpkgs>" -iA emscripten` 19 * `nix-shell -p emscripten` 20 21 * **Declarative usage**: 22 23 + This mode is far more power full since this makes use of `nix` for dependency management of emscripten libraries and targets by using the `mkDerivation` which is implemented by `pkgs.emscriptenStdenv` and `pkgs.buildEmscriptenPackage`. The source for the packages is in `pkgs/top-level/emscripten-packages.nix` and the abstraction behind it in `pkgs/development/em-modules/generic/default.nix`. From the root of the nixpkgs repository: 24 * build and install all packages: 25 * `nix-env -iA emscriptenPackages` 26
+1 -4
doc/languages-frameworks/idris.section.md
··· 5 The easiest way to get a working idris version is to install the `idris` attribute: 6 7 ```ShellSession 8 - $ # On NixOS 9 - $ nix-env -i nixos.idris 10 - $ # On non-NixOS 11 - $ nix-env -i nixpkgs.idris 12 ``` 13 14 This however only provides the `prelude` and `base` libraries. To install idris with additional libraries, you can use the `idrisPackages.with-packages` function, e.g. in an overlay in `~/.config/nixpkgs/overlays/my-idris.nix`:
··· 5 The easiest way to get a working idris version is to install the `idris` attribute: 6 7 ```ShellSession 8 + $ nix-env -f "<nixpkgs>" -iA idris 9 ``` 10 11 This however only provides the `prelude` and `base` libraries. To install idris with additional libraries, you can use the `idrisPackages.with-packages` function, e.g. in an overlay in `~/.config/nixpkgs/overlays/my-idris.nix`:
+2 -10
doc/languages-frameworks/octave.section.md
··· 24 $ nix-build -A octavePackages.symbolic 25 ``` 26 27 - When building Octave packages with `nix-build`, the `buildOctavePackage` function adds `octave-octaveVersion` to; the start of the package's name attribute. 28 - 29 - This can be required when installing the package using `nix-env`: 30 - 31 - ```ShellSession 32 - $ nix-env -i octave-6.2.0-symbolic 33 - ``` 34 - 35 - Although, you can also install it using the attribute name: 36 37 ```ShellSession 38 - $ nix-env -i -A octavePackages.symbolic 39 ``` 40 41 You can build Octave with packages by using the `withPackages` passed-through function.
··· 24 $ nix-build -A octavePackages.symbolic 25 ``` 26 27 + To install it into your user profile, run this command from the root of the repository: 28 29 ```ShellSession 30 + $ nix-env -f. -iA octavePackages.symbolic 31 ``` 32 33 You can build Octave with packages by using the `withPackages` passed-through function.
+4 -8
doc/languages-frameworks/perl.section.md
··· 58 $ nix-build -A perlPackages.ClassC3 59 ``` 60 61 - `buildPerlPackage` adds `perl-` to the start of the name attribute, so the package above is actually called `perl-Class-C3-0.21`. So to install it, you can say: 62 - 63 - ```ShellSession 64 - $ nix-env -i perl-Class-C3 65 - ``` 66 - 67 - (Of course you can also install using the attribute name: `nix-env -i -A perlPackages.ClassC3`.) 68 69 So what does `buildPerlPackage` do? It does the following: 70 ··· 135 Nix expressions for Perl packages can be generated (almost) automatically from CPAN. This is done by the program `nix-generate-from-cpan`, which can be installed as follows: 136 137 ```ShellSession 138 - $ nix-env -i nix-generate-from-cpan 139 ``` 140 141 This program takes a Perl module name, looks it up on CPAN, fetches and unpacks the corresponding package, and prints a Nix expression on standard output. For example: 142
··· 58 $ nix-build -A perlPackages.ClassC3 59 ``` 60 61 + To install it with `nix-env` instead: `nix-env -f. -iA perlPackages.ClassC3`. 62 63 So what does `buildPerlPackage` do? It does the following: 64 ··· 129 Nix expressions for Perl packages can be generated (almost) automatically from CPAN. This is done by the program `nix-generate-from-cpan`, which can be installed as follows: 130 131 ```ShellSession 132 + $ nix-env -f "<nixpkgs>" -iA nix-generate-from-cpan 133 ``` 134 + 135 + Substitute `<nixpkgs>` by the path of a nixpkgs clone to use the latest version. 136 137 This program takes a Perl module name, looks it up on CPAN, fetches and unpacks the corresponding package, and prints a Nix expression on standard output. For example: 138