diff --git a/pages/common/nix-build.2.md b/pages/common/nix-build.2.md new file mode 100644 index 0000000000..3765a5c591 --- /dev/null +++ b/pages/common/nix-build.2.md @@ -0,0 +1,13 @@ +# nix-build + +> Build a Nix expression. +> See also: `nix build.3`. +> More information: . + +- Build a Nix expression: + +`nix-build '' {{[-A|--attr]}} {{firefox}}` + +- Build a sandboxed Nix expression (on non-NixOS): + +`nix-build '' {{[-A|--attr]}} {{firefox}} --option sandbox true` diff --git a/pages/common/nix3-build.md b/pages/common/nix-build.3.md similarity index 91% rename from pages/common/nix3-build.md rename to pages/common/nix-build.3.md index 957fee2d0a..ad3f034982 100644 --- a/pages/common/nix3-build.md +++ b/pages/common/nix-build.3.md @@ -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: . - Build a package from nixpkgs, symlinking the result to `./result`: diff --git a/pages/common/nix-build.md b/pages/common/nix-build.md index 49d181ecfb..126ea8bcfd 100644 --- a/pages/common/nix-build.md +++ b/pages/common/nix-build.md @@ -1,13 +1,11 @@ # nix-build -> Build a Nix expression. -> See also: `nix3 build`. -> More information: . +> `nix-build` can refer to multiple commands with the same name. -- Build a Nix expression: +- View documentation for the traditional builder: -`nix-build '' {{[-A|--attr]}} {{firefox}}` +`tldr nix-build.2` -- Build a sandboxed Nix expression (on non-NixOS): +- View documentation for nix3 builder: -`nix-build '' {{[-A|--attr]}} {{firefox}} --option sandbox true` +`tldr nix build.3` diff --git a/pages/common/nix3-develop.md b/pages/common/nix-develop.md similarity index 100% rename from pages/common/nix3-develop.md rename to pages/common/nix-develop.md diff --git a/pages/common/nix3-edit.md b/pages/common/nix-edit.md similarity index 100% rename from pages/common/nix3-edit.md rename to pages/common/nix-edit.md diff --git a/pages/common/nix3-flake.md b/pages/common/nix-flake.md similarity index 100% rename from pages/common/nix3-flake.md rename to pages/common/nix-flake.md diff --git a/pages/common/nix3-profile.md b/pages/common/nix-profile.md similarity index 100% rename from pages/common/nix3-profile.md rename to pages/common/nix-profile.md diff --git a/pages/common/nix3-registry.md b/pages/common/nix-registry.md similarity index 93% rename from pages/common/nix3-registry.md rename to pages/common/nix-registry.md index 3ce75b28b5..941ac44171 100644 --- a/pages/common/nix3-registry.md +++ b/pages/common/nix-registry.md @@ -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: . - Pin the `nixpkgs` revision to the current version of the upstream repository: diff --git a/pages/common/nix3-repl.md b/pages/common/nix-repl.md similarity index 100% rename from pages/common/nix3-repl.md rename to pages/common/nix-repl.md diff --git a/pages/common/nix3-run.md b/pages/common/nix-run.md similarity index 93% rename from pages/common/nix3-run.md rename to pages/common/nix-run.md index c63f9bece9..be56d51702 100644 --- a/pages/common/nix3-run.md +++ b/pages/common/nix-run.md @@ -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: . - 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}}` diff --git a/pages/common/nix3-search.md b/pages/common/nix-search.md similarity index 88% rename from pages/common/nix3-search.md rename to pages/common/nix-search.md index 184baede60..875b0ee906 100644 --- a/pages/common/nix3-search.md +++ b/pages/common/nix-search.md @@ -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: . - Search `nixpkgs` for a package based on its name or description: diff --git a/pages/common/nix-shell.2.md b/pages/common/nix-shell.2.md new file mode 100644 index 0000000000..826af4c2c5 --- /dev/null +++ b/pages/common/nix-shell.2.md @@ -0,0 +1,29 @@ +# nix-shell + +> Start an interactive shell based on a Nix expression. +> See also: `nix shell.3`. +> More information: . + +- 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 ): + +`nix-shell -i {{interpreter}} {{[-p|--packages]}} {{package1 package2 ...}}` diff --git a/pages/common/nix3-shell.md b/pages/common/nix-shell.3.md similarity index 95% rename from pages/common/nix3-shell.md rename to pages/common/nix-shell.3.md index 29e046a406..9c35a7d65b 100644 --- a/pages/common/nix3-shell.md +++ b/pages/common/nix-shell.3.md @@ -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: . - Start an interactive shell with some packages from `nixpkgs`: diff --git a/pages/common/nix-shell.md b/pages/common/nix-shell.md index 08ed62d190..26ca927442 100644 --- a/pages/common/nix-shell.md +++ b/pages/common/nix-shell.md @@ -1,29 +1,11 @@ # nix-shell -> Start an interactive shell based on a Nix expression. -> See also: `nix3 shell`. -> More information: . +> `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 ): - -`nix-shell -i {{interpreter}} {{[-p|--packages]}} {{package1 package2 ...}}` +`tldr nix shell.3` diff --git a/pages/common/nix-store.2.md b/pages/common/nix-store.2.md new file mode 100644 index 0000000000..ae01d7f9a7 --- /dev/null +++ b/pages/common/nix-store.2.md @@ -0,0 +1,29 @@ +# nix-store + +> Manipulate or query the Nix store. +> See also: `nix store.3`. +> More information: . + +- 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/...}}` diff --git a/pages/common/nix3-store.md b/pages/common/nix-store.3.md similarity index 100% rename from pages/common/nix3-store.md rename to pages/common/nix-store.3.md diff --git a/pages/common/nix-store.md b/pages/common/nix-store.md index 5f5cdcdd6f..b528b7b445 100644 --- a/pages/common/nix-store.md +++ b/pages/common/nix-store.md @@ -1,29 +1,11 @@ # nix-store -> Manipulate or query the Nix store. -> See also: `nix3 store`. -> More information: . +> `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` diff --git a/pages/common/nix3-why-depends.md b/pages/common/nix-why-depends.md similarity index 100% rename from pages/common/nix3-why-depends.md rename to pages/common/nix-why-depends.md diff --git a/scripts/wrong-filename.sh b/scripts/wrong-filename.sh index 0356850646..6cf415d99b 100755 --- a/scripts/wrong-filename.sh +++ b/scripts/wrong-filename.sh @@ -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:]')