mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-08 05:26:03 +02:00
nix*: make filenames reflect the commands and create disambiguation pages (#16343)
This commit is contained in:
parent
0faf88f3ca
commit
03d6647632
19 changed files with 93 additions and 60 deletions
13
pages/common/nix-build.2.md
Normal file
13
pages/common/nix-build.2.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# nix-build
|
||||
|
||||
> Build a Nix expression.
|
||||
> See also: `nix build.3`.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-build.html>.
|
||||
|
||||
- Build a Nix expression:
|
||||
|
||||
`nix-build '<nixpkgs>' {{[-A|--attr]}} {{firefox}}`
|
||||
|
||||
- Build a sandboxed Nix expression (on non-NixOS):
|
||||
|
||||
`nix-build '<nixpkgs>' {{[-A|--attr]}} {{firefox}} --option sandbox true`
|
|
@ -1,7 +1,7 @@
|
|||
# nix build
|
||||
|
||||
> Build a Nix expression (downloading from the cache when possible).
|
||||
> See also: `nix-build` for information about traditional Nix builds from expressions, `nix3 flake` for information about flakes.
|
||||
> See also: `nix-build` for information about traditional Nix builds from expressions, `nix flake` for information about flakes.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-build.html>.
|
||||
|
||||
- Build a package from nixpkgs, symlinking the result to `./result`:
|
|
@ -1,13 +1,11 @@
|
|||
# nix-build
|
||||
|
||||
> Build a Nix expression.
|
||||
> See also: `nix3 build`.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-build.html>.
|
||||
> `nix-build` can refer to multiple commands with the same name.
|
||||
|
||||
- Build a Nix expression:
|
||||
- View documentation for the traditional builder:
|
||||
|
||||
`nix-build '<nixpkgs>' {{[-A|--attr]}} {{firefox}}`
|
||||
`tldr nix-build.2`
|
||||
|
||||
- Build a sandboxed Nix expression (on non-NixOS):
|
||||
- View documentation for nix3 builder:
|
||||
|
||||
`nix-build '<nixpkgs>' {{[-A|--attr]}} {{firefox}} --option sandbox true`
|
||||
`tldr nix build.3`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# nix registry
|
||||
|
||||
> Manage a Nix flake registry.
|
||||
> See also: `nix3 flake` for information about flakes.
|
||||
> See also: `nix flake` for information about flakes.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-registry.html>.
|
||||
|
||||
- Pin the `nixpkgs` revision to the current version of the upstream repository:
|
|
@ -1,14 +1,14 @@
|
|||
# nix run
|
||||
|
||||
> Run an application from a Nix flake.
|
||||
> See also: `nix3 flake` for information about flakes.
|
||||
> See also: `nix flake` for information about flakes.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-run.html>.
|
||||
|
||||
- Run the default application in the flake in the current directory:
|
||||
|
||||
`nix run`
|
||||
|
||||
- Run a command whose name matches the package name from nixpkgs (if you want a different command from that package, see `tldr nix3 shell`):
|
||||
- Run a command whose name matches the package name from nixpkgs (if you want a different command from that package, see `tldr nix shell`):
|
||||
|
||||
`nix run nixpkgs#{{pkg}}`
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# nix search
|
||||
|
||||
> Search for packages in a Nix flake.
|
||||
> See also: `nix3 flake` for information about flakes.
|
||||
> See also: `nix flake` for information about flakes.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-search.html>.
|
||||
|
||||
- Search `nixpkgs` for a package based on its name or description:
|
29
pages/common/nix-shell.2.md
Normal file
29
pages/common/nix-shell.2.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# nix-shell
|
||||
|
||||
> Start an interactive shell based on a Nix expression.
|
||||
> See also: `nix shell.3`.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-shell.html>.
|
||||
|
||||
- Start with nix expression in `shell.nix` or `default.nix` in the current directory:
|
||||
|
||||
`nix-shell`
|
||||
|
||||
- Run shell command in non-interactive shell and exit:
|
||||
|
||||
`nix-shell --run "{{command}} {{argument1 argument2 ...}}"`
|
||||
|
||||
- Start with expression in `default.nix` in the current directory:
|
||||
|
||||
`nix-shell {{default.nix}}`
|
||||
|
||||
- Start with packages loaded from nixpkgs:
|
||||
|
||||
`nix-shell {{[-p|--packages]}} {{package1 package2 ...}}`
|
||||
|
||||
- Start with packages loaded from specific nixpkgs revision:
|
||||
|
||||
`nix-shell {{[-p|--packages]}} {{package1 package2 ...}} {{[-I|--include]}} nixpkgs={{https://github.com/NixOS/nixpkgs/archive/nixpkgs_revision.tar.gz}}`
|
||||
|
||||
- Evaluate rest of file in specific interpreter, for use in `#!-scripts` (see <https://nixos.org/manual/nix/stable/#use-as-a-interpreter>):
|
||||
|
||||
`nix-shell -i {{interpreter}} {{[-p|--packages]}} {{package1 package2 ...}}`
|
|
@ -1,7 +1,7 @@
|
|||
# nix shell
|
||||
|
||||
> Start a shell in which the specified packages are available.
|
||||
> See also: `nix-shell` for setting up development environments, `nix3 flake` for information about flakes.
|
||||
> See also: `nix-shell` for setting up development environments, `nix flake` for information about flakes.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-shell.html>.
|
||||
|
||||
- Start an interactive shell with some packages from `nixpkgs`:
|
|
@ -1,29 +1,11 @@
|
|||
# nix-shell
|
||||
|
||||
> Start an interactive shell based on a Nix expression.
|
||||
> See also: `nix3 shell`.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-shell.html>.
|
||||
> `nix-shell` can refer to multiple commands with the same name.
|
||||
|
||||
- Start with nix expression in `shell.nix` or `default.nix` in the current directory:
|
||||
- View documentation for the traditional shell:
|
||||
|
||||
`nix-shell`
|
||||
`tldr nix-shell.2`
|
||||
|
||||
- Run shell command in non-interactive shell and exit:
|
||||
- View documentation for nix3 shell:
|
||||
|
||||
`nix-shell --run "{{command}} {{argument1 argument2 ...}}"`
|
||||
|
||||
- Start with expression in `default.nix` in the current directory:
|
||||
|
||||
`nix-shell {{default.nix}}`
|
||||
|
||||
- Start with packages loaded from nixpkgs:
|
||||
|
||||
`nix-shell {{[-p|--packages]}} {{package1 package2 ...}}`
|
||||
|
||||
- Start with packages loaded from specific nixpkgs revision:
|
||||
|
||||
`nix-shell {{[-p|--packages]}} {{package1 package2 ...}} {{[-I|--include]}} nixpkgs={{https://github.com/NixOS/nixpkgs/archive/nixpkgs_revision.tar.gz}}`
|
||||
|
||||
- Evaluate rest of file in specific interpreter, for use in `#!-scripts` (see <https://nixos.org/manual/nix/stable/#use-as-a-interpreter>):
|
||||
|
||||
`nix-shell -i {{interpreter}} {{[-p|--packages]}} {{package1 package2 ...}}`
|
||||
`tldr nix shell.3`
|
||||
|
|
29
pages/common/nix-store.2.md
Normal file
29
pages/common/nix-store.2.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# nix-store
|
||||
|
||||
> Manipulate or query the Nix store.
|
||||
> See also: `nix store.3`.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-store.html>.
|
||||
|
||||
- Collect garbage, such as removing unused paths:
|
||||
|
||||
`nix-store --gc`
|
||||
|
||||
- Hard-link identical files together to reduce space usage:
|
||||
|
||||
`nix-store --optimise`
|
||||
|
||||
- Delete a specific store path (must be unused):
|
||||
|
||||
`nix-store --delete {{/nix/store/...}}`
|
||||
|
||||
- Show all dependencies of a store path (package), in a tree format:
|
||||
|
||||
`nix-store {{[-q|--query]}} --tree {{/nix/store/...}}`
|
||||
|
||||
- Calculate the total size of a certain store path with all the dependencies:
|
||||
|
||||
`du {{[-cLsh|--total --dereference --summarize --human-readable]}} $(nix-store {{[-q|--query]}} --references {{/nix/store/...}})`
|
||||
|
||||
- Show all dependents of a particular store path:
|
||||
|
||||
`nix-store {{[-q|--query]}} --referrers {{/nix/store/...}}`
|
|
@ -1,29 +1,11 @@
|
|||
# nix-store
|
||||
|
||||
> Manipulate or query the Nix store.
|
||||
> See also: `nix3 store`.
|
||||
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-store.html>.
|
||||
> `nix-store` can refer to multiple commands with the same name.
|
||||
|
||||
- Collect garbage, such as removing unused paths:
|
||||
- View documentation for the traditional store:
|
||||
|
||||
`nix-store --gc`
|
||||
`tldr nix-store.2`
|
||||
|
||||
- Hard-link identical files together to reduce space usage:
|
||||
- View documentation for nix3 store:
|
||||
|
||||
`nix-store --optimise`
|
||||
|
||||
- Delete a specific store path (must be unused):
|
||||
|
||||
`nix-store --delete {{/nix/store/...}}`
|
||||
|
||||
- Show all dependencies of a store path (package), in a tree format:
|
||||
|
||||
`nix-store {{[-q|--query]}} --tree {{/nix/store/...}}`
|
||||
|
||||
- Calculate the total size of a certain store path with all the dependencies:
|
||||
|
||||
`du {{[-cLsh|--total --dereference --summarize --human-readable]}} $(nix-store {{[-q|--query]}} --references {{/nix/store/...}})`
|
||||
|
||||
- Show all dependents of a particular store path:
|
||||
|
||||
`nix-store {{[-q|--query]}} --referrers {{/nix/store/...}}`
|
||||
`tldr nix store.3`
|
||||
|
|
|
@ -17,7 +17,7 @@ set -e
|
|||
# Iterate through all Markdown files in the 'pages' directories
|
||||
find pages* -name '*.md' -type f | while read -r path; do
|
||||
# Extract the expected command name from the filename
|
||||
COMMAND_NAME_FILE=$(basename "$path" | head -c-4 | sed 's/nix3/nix/' | sed 's/\.fish//' | sed 's/\.js//' | sed 's/\.1//' | tr '-' ' ' | tr '[:upper:]' '[:lower:]')
|
||||
COMMAND_NAME_FILE=$(basename "$path" | head -c-4 | sed 's/\.fish//' | sed 's/\.js//' | sed 's/\.1//' | tr '-' ' ' | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Extract the command name from the first line of the Markdown file
|
||||
COMMAND_NAME_PAGE=$(head -n1 "$path" | tail -c+3 | sed 's/--//' | tr '-' ' ' | tr '[:upper:]' '[:lower:]')
|
||||
|
|
Loading…
Add table
Reference in a new issue