tuto:nix
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
tuto:nix [2020/03/14 11:04] – [nix-channel] root | tuto:nix [2022/06/21 20:15] (Version actuelle) – [nix-shell] root | ||
---|---|---|---|
Ligne 44: | Ligne 44: | ||
</ | </ | ||
+ | ==== NIX_PAGER ==== | ||
< | < | ||
export NIX_PAGER= | export NIX_PAGER= | ||
+ | </ | ||
+ | |||
+ | ==== nixpkgs ==== | ||
+ | < | ||
+ | nixpkgs=https:// | ||
+ | nixpkgs=channel: | ||
</ | </ | ||
Ligne 67: | Ligne 74: | ||
$ nix-env -u --dry-run | $ nix-env -u --dry-run | ||
$ nix-env -e hello | $ nix-env -e hello | ||
+ | </ | ||
+ | |||
+ | Force a specific channel (master in this example): | ||
+ | < | ||
+ | $ nix-env -f https:// | ||
</ | </ | ||
Ligne 128: | Ligne 140: | ||
==== nix-shell ==== | ==== nix-shell ==== | ||
* https:// | * https:// | ||
+ | |||
+ | <code haskell shell.nix> | ||
+ | { pkgs ? import < | ||
+ | |||
+ | with pkgs; | ||
+ | |||
+ | mkShell { | ||
+ | buildInputs = [ | ||
+ | elixir_1_10 | ||
+ | nodejs-12_x | ||
+ | ]; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ nix-shell | ||
+ | $ nix-shell shell.nix | ||
+ | </ | ||
+ | |||
< | < | ||
$ nix-shell --pure -E ' | $ nix-shell --pure -E ' | ||
Ligne 144: | Ligne 175: | ||
< | < | ||
$ nix-shell '< | $ nix-shell '< | ||
+ | </ | ||
+ | |||
+ | Force a specific channel: | ||
+ | < | ||
+ | $ nix-shell -p hello -I nixpkgs=https:// | ||
</ | </ | ||
Ligne 319: | Ligne 355: | ||
path is '/ | path is '/ | ||
02cgs6b1rmh8hmcwm5wpxxg32p3km9c05606pykv49qq1spd6p38 | 02cgs6b1rmh8hmcwm5wpxxg32p3km9c05606pykv49qq1spd6p38 | ||
+ | </ | ||
+ | |||
+ | ==== nix-instantiate ==== | ||
+ | < | ||
+ | $ nix-instantiate --eval -E ' | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ nix-instantiate --eval -E ' | ||
+ | " | ||
</ | </ | ||
Ligne 421: | Ligne 468: | ||
Welcome to Nix version 2.3.3. Type :? for help. | Welcome to Nix version 2.3.3. Type :? for help. | ||
- | $ nix-repl> | + | nix-repl> |
" | " | ||
</ | </ | ||
< | < | ||
- | $ nix-repl> | + | $ nix repl |
+ | nix-repl> | ||
nix-repl> | nix-repl> | ||
nix-repl> | nix-repl> | ||
this derivation produced the following outputs: out -> / | this derivation produced the following outputs: out -> / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | nix-repl> | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | === nix edit === | ||
+ | Permet d' | ||
+ | < | ||
+ | $ EDITOR=vim nix edit -f "< | ||
+ | </ | ||
+ | |||
+ | On install ensuite le paquet: | ||
+ | < | ||
+ | $ nix-env -i samba | ||
</ | </ | ||
Ligne 510: | Ligne 574: | ||
</ | </ | ||
- | ==== Chemains | + | ==== Chemins |
< | < | ||
$ nix eval ' | $ nix eval ' | ||
Ligne 614: | Ligne 678: | ||
==== Override ==== | ==== Override ==== | ||
< | < | ||
- | $ nix-repl | + | $ nix repl |
nix-repl> | nix-repl> | ||
Added 4360 variables. | Added 4360 variables. |
tuto/nix.1584183875.txt.gz · Dernière modification : 2020/03/14 11:04 de root