Also use long options in src/nix/*.md
This commit is contained in:
parent
8d4b6766e2
commit
afd9bd787d
|
@ -44,7 +44,7 @@ R""(
|
||||||
`release.nix`:
|
`release.nix`:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix build -f release.nix build.x86_64-linux
|
# nix build --file release.nix build.x86_64-linux
|
||||||
```
|
```
|
||||||
|
|
||||||
* Build a NixOS system configuration from a flake, and make a profile
|
* Build a NixOS system configuration from a flake, and make a profile
|
||||||
|
|
|
@ -15,7 +15,7 @@ R""(
|
||||||
SSH:
|
SSH:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix copy -s --to ssh://server /run/current-system
|
# nix copy --substitute-on-destination --to ssh://server /run/current-system
|
||||||
```
|
```
|
||||||
|
|
||||||
The `-s` flag causes the remote machine to try to substitute missing
|
The `-s` flag causes the remote machine to try to substitute missing
|
||||||
|
|
|
@ -69,7 +69,7 @@ R""(
|
||||||
* Run a series of script commands:
|
* Run a series of script commands:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix develop --command bash -c "mkdir build && cmake .. && make"
|
# nix develop --command bash --command "mkdir build && cmake .. && make"
|
||||||
```
|
```
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
|
|
|
@ -18,7 +18,7 @@ R""(
|
||||||
* Evaluate a Nix expression from a file:
|
* Evaluate a Nix expression from a file:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix eval -f ./my-nixpkgs hello.name
|
# nix eval --file ./my-nixpkgs hello.name
|
||||||
```
|
```
|
||||||
|
|
||||||
* Get the current version of the `nixpkgs` flake:
|
* Get the current version of the `nixpkgs` flake:
|
||||||
|
|
|
@ -68,6 +68,6 @@ The following flake output attributes must be
|
||||||
In addition, the `hydraJobs` output is evaluated in the same way as
|
In addition, the `hydraJobs` output is evaluated in the same way as
|
||||||
Hydra's `hydra-eval-jobs` (i.e. as a arbitrarily deeply nested
|
Hydra's `hydra-eval-jobs` (i.e. as a arbitrarily deeply nested
|
||||||
attribute set of derivations). Similarly, the
|
attribute set of derivations). Similarly, the
|
||||||
`legacyPackages`.*system* output is evaluated like `nix-env -qa`.
|
`legacyPackages`.*system* output is evaluated like `nix-env --query --available `.
|
||||||
|
|
||||||
)""
|
)""
|
||||||
|
|
|
@ -5,7 +5,7 @@ R""(
|
||||||
* To list a specific file in a NAR:
|
* To list a specific file in a NAR:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix nar ls -l ./hello.nar /bin/hello
|
# nix nar ls --long ./hello.nar /bin/hello
|
||||||
-r-xr-xr-x 38184 hello
|
-r-xr-xr-x 38184 hello
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ R""(
|
||||||
format:
|
format:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix nar ls --json -R ./hello.nar /bin
|
# nix nar ls --json --recursive ./hello.nar /bin
|
||||||
{"type":"directory","entries":{"hello":{"type":"regular","size":38184,"executable":true,"narOffset":400}}}
|
{"type":"directory","entries":{"hello":{"type":"regular","size":38184,"executable":true,"narOffset":400}}}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ operate are determined as follows:
|
||||||
of all outputs of the `glibc` package in the binary cache:
|
of all outputs of the `glibc` package in the binary cache:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix path-info -S --eval-store auto --store https://cache.nixos.org 'nixpkgs#glibc^*'
|
# nix path-info --closure-size --eval-store auto --store https://cache.nixos.org 'nixpkgs#glibc^*'
|
||||||
/nix/store/g02b1lpbddhymmcjb923kf0l7s9nww58-glibc-2.33-123 33208200
|
/nix/store/g02b1lpbddhymmcjb923kf0l7s9nww58-glibc-2.33-123 33208200
|
||||||
/nix/store/851dp95qqiisjifi639r0zzg5l465ny4-glibc-2.33-123-bin 36142896
|
/nix/store/851dp95qqiisjifi639r0zzg5l465ny4-glibc-2.33-123-bin 36142896
|
||||||
/nix/store/kdgs3q6r7xdff1p7a9hnjr43xw2404z7-glibc-2.33-123-debug 155787312
|
/nix/store/kdgs3q6r7xdff1p7a9hnjr43xw2404z7-glibc-2.33-123-debug 155787312
|
||||||
|
@ -208,7 +208,7 @@ operate are determined as follows:
|
||||||
and likewise, using a store path to a "drv" file to specify the derivation:
|
and likewise, using a store path to a "drv" file to specify the derivation:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix path-info -S '/nix/store/gzaflydcr6sb3567hap9q6srzx8ggdgg-glibc-2.33-78.drv^*'
|
# nix path-info --closure-size '/nix/store/gzaflydcr6sb3567hap9q6srzx8ggdgg-glibc-2.33-78.drv^*'
|
||||||
…
|
…
|
||||||
```
|
```
|
||||||
* If you didn't specify the desired outputs, but the derivation has an
|
* If you didn't specify the desired outputs, but the derivation has an
|
||||||
|
|
|
@ -13,7 +13,7 @@ R""(
|
||||||
closure, sorted by size:
|
closure, sorted by size:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix path-info -rS /run/current-system | sort -nk2
|
# nix path-info --recursive --closure-size /run/current-system | sort -nk2
|
||||||
/nix/store/hl5xwp9kdrd1zkm0idm3kkby9q66z404-empty 96
|
/nix/store/hl5xwp9kdrd1zkm0idm3kkby9q66z404-empty 96
|
||||||
/nix/store/27324qvqhnxj3rncazmxc4mwy79kz8ha-nameservers 112
|
/nix/store/27324qvqhnxj3rncazmxc4mwy79kz8ha-nameservers 112
|
||||||
…
|
…
|
||||||
|
@ -25,7 +25,7 @@ R""(
|
||||||
readable sizes:
|
readable sizes:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix path-info -rsSh nixpkgs#rustc
|
# nix path-info --recursive --size --closure-size --human-readable nixpkgs#rustc
|
||||||
/nix/store/01rrgsg5zk3cds0xgdsq40zpk6g51dz9-ncurses-6.2-dev 386.7K 69.1M
|
/nix/store/01rrgsg5zk3cds0xgdsq40zpk6g51dz9-ncurses-6.2-dev 386.7K 69.1M
|
||||||
/nix/store/0q783wnvixpqz6dxjp16nw296avgczam-libpfm-4.11.0 5.9M 37.4M
|
/nix/store/0q783wnvixpqz6dxjp16nw296avgczam-libpfm-4.11.0 5.9M 37.4M
|
||||||
…
|
…
|
||||||
|
@ -34,7 +34,7 @@ R""(
|
||||||
* Check the existence of a path in a binary cache:
|
* Check the existence of a path in a binary cache:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix path-info -r /nix/store/blzxgyvrk32ki6xga10phr4sby2xf25q-geeqie-1.5.1 --store https://cache.nixos.org/
|
# nix path-info --recursive /nix/store/blzxgyvrk32ki6xga10phr4sby2xf25q-geeqie-1.5.1 --store https://cache.nixos.org/
|
||||||
path '/nix/store/blzxgyvrk32ki6xga10phr4sby2xf25q-geeqie-1.5.1' is not valid
|
path '/nix/store/blzxgyvrk32ki6xga10phr4sby2xf25q-geeqie-1.5.1' is not valid
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -57,7 +57,7 @@ R""(
|
||||||
size:
|
size:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix path-info --json --all -S \
|
# nix path-info --json --all --closure-size \
|
||||||
| jq 'map(select(.closureSize > 1e9)) | sort_by(.closureSize) | map([.path, .closureSize])'
|
| jq 'map(select(.closureSize > 1e9)) | sort_by(.closureSize) | map([.path, .closureSize])'
|
||||||
[
|
[
|
||||||
…,
|
…,
|
||||||
|
|
|
@ -52,12 +52,12 @@ R""(
|
||||||
* Search for packages containing `neovim` but hide ones containing either `gui` or `python`:
|
* Search for packages containing `neovim` but hide ones containing either `gui` or `python`:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix search nixpkgs neovim -e 'python|gui'
|
# nix search nixpkgs neovim --exclude 'python|gui'
|
||||||
```
|
```
|
||||||
or
|
or
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix search nixpkgs neovim -e 'python' -e 'gui'
|
# nix search nixpkgs neovim --exclude 'python' --exclude 'gui'
|
||||||
```
|
```
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
|
|
|
@ -19,26 +19,26 @@ R""(
|
||||||
* Run GNU Hello:
|
* Run GNU Hello:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix shell nixpkgs#hello -c hello --greeting 'Hi everybody!'
|
# nix shell nixpkgs#hello --command hello --greeting 'Hi everybody!'
|
||||||
Hi everybody!
|
Hi everybody!
|
||||||
```
|
```
|
||||||
|
|
||||||
* Run multiple commands in a shell environment:
|
* Run multiple commands in a shell environment:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix shell nixpkgs#gnumake -c sh -c "cd src && make"
|
# nix shell nixpkgs#gnumake --command sh --command "cd src && make"
|
||||||
```
|
```
|
||||||
|
|
||||||
* Run GNU Hello in a chroot store:
|
* Run GNU Hello in a chroot store:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix shell --store ~/my-nix nixpkgs#hello -c hello
|
# nix shell --store ~/my-nix nixpkgs#hello --command hello
|
||||||
```
|
```
|
||||||
|
|
||||||
* Start a shell providing GNU Hello in a chroot store:
|
* Start a shell providing GNU Hello in a chroot store:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix shell --store ~/my-nix nixpkgs#hello nixpkgs#bashInteractive -c bash
|
# nix shell --store ~/my-nix nixpkgs#hello nixpkgs#bashInteractive --command bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that it's necessary to specify `bash` explicitly because your
|
Note that it's necessary to specify `bash` explicitly because your
|
||||||
|
|
|
@ -5,7 +5,7 @@ R""(
|
||||||
* To list the contents of a store path in a binary cache:
|
* To list the contents of a store path in a binary cache:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix store ls --store https://cache.nixos.org/ -lR /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10
|
# nix store ls --store https://cache.nixos.org/ --long --recursive /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10
|
||||||
dr-xr-xr-x 0 ./bin
|
dr-xr-xr-x 0 ./bin
|
||||||
-r-xr-xr-x 38184 ./bin/hello
|
-r-xr-xr-x 38184 ./bin/hello
|
||||||
dr-xr-xr-x 0 ./share
|
dr-xr-xr-x 0 ./share
|
||||||
|
@ -15,7 +15,7 @@ R""(
|
||||||
* To show information about a specific file in a binary cache:
|
* To show information about a specific file in a binary cache:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix store ls --store https://cache.nixos.org/ -l /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10/bin/hello
|
# nix store ls --store https://cache.nixos.org/ --long /nix/store/0i2jd68mp5g6h2sa5k9c85rb80sn8hi9-hello-2.10/bin/hello
|
||||||
-r-xr-xr-x 38184 hello
|
-r-xr-xr-x 38184 hello
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ R""(
|
||||||
* Upgrade Nix in a specific profile:
|
* Upgrade Nix in a specific profile:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix upgrade-nix -p ~alice/.local/state/nix/profiles/profile
|
# nix upgrade-nix --profile ~alice/.local/state/nix/profiles/profile
|
||||||
```
|
```
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
|
|
|
@ -12,7 +12,7 @@ R""(
|
||||||
signatures:
|
signatures:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# nix store verify -r -n2 --no-contents $(type -p firefox)
|
# nix store verify --recursive --sigs-needed 2 --no-contents $(type -p firefox)
|
||||||
```
|
```
|
||||||
|
|
||||||
* Verify a store path in the binary cache `https://cache.nixos.org/`:
|
* Verify a store path in the binary cache `https://cache.nixos.org/`:
|
||||||
|
|
Loading…
Reference in a new issue