diff --git a/tldr/kite b/tldr/kite new file mode 100644 index 00000000..796e3060 --- /dev/null +++ b/tldr/kite @@ -0,0 +1,12 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kite + +> This command is an alias of `kiterunner`. + +- View documentation for the original command: + +`tldr kiterunner` diff --git a/tldr/kiterunner b/tldr/kiterunner new file mode 100644 index 00000000..1161ca37 --- /dev/null +++ b/tldr/kiterunner @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kiterunner + +> A contextual web scanner for discovering API paths and web endpoints using wordlists and kitebuilder schemas. +> More information: . + +- View documentation for bruteforcing API paths and web endpoints: + +`tldr kiterunner brute` + +- View documentation for concurrently scanning hosts with kitebuilder wordlists: + +`tldr kiterunner scan` + +- View documentation for manipulating kitebuilder schemas: + +`tldr kiterunner kb` + +- View documentation for managing cached and remote wordlists: + +`tldr kiterunner wordlist` diff --git a/tldr/kiterunner-brute b/tldr/kiterunner-brute new file mode 100644 index 00000000..6a7c0eb2 --- /dev/null +++ b/tldr/kiterunner-brute @@ -0,0 +1,42 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kiterunner brute + +> A contextual web scanner for bruteforcing API paths and web endpoints using wordlists. +> The `brute` subcommand targets one or multiple hosts. +> More information: . + +- Bruteforce a target with an Assetnote wordlist (e.g., first 20,000 API routes): + +`kiterunner brute {{https://example.com}} {{[-A|--assetnote-wordlist]}} {{apiroutes-210328:20000}}` + +- Bruteforce a target with a custom wordlist: + +`kiterunner brute {{https://example.com}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}}` + +- Bruteforce using a dirsearch-style wordlist with extension substitution: + +`kiterunner brute {{https://example.com}} {{[-w|--wordlist]}} {{path/to/dirsearch.txt}} {{[-D|--dirsearch-compat]}} {{[-e|--extensions]}} {{json,txt}}` + +- Bruteforce with specific file extensions appended and output in JSON format: + +`kiterunner brute {{https://example.com}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}} {{[-e|--extensions]}} {{aspx,ashx}} {{[-o|--output]}} {{json}}` + +- Bruteforce a list of targets from a file with custom concurrency settings for performance: + +`kiterunner brute {{path/to/targets.txt}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}} {{[-x|--max-connection-per-host]}} {{5}} {{[-j|--max-parallel-hosts]}} {{100}}` + +- Bruteforce and ignore specific content length responses: + +`kiterunner brute {{https://example.com}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}} --ignore-length {{100-105}}` + +- Bruteforce with custom HTTP headers: + +`kiterunner brute {{https://example.com}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}} {{[-H|--header]}} "{{Authorization: Bearer token}}"` + +- Bruteforce a list of targets from a file with fail status code filtering: + +`kiterunner brute {{path/to/targets.txt}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}} --fail-status-codes {{400,401,404}}` diff --git a/tldr/kiterunner-kb b/tldr/kiterunner-kb new file mode 100644 index 00000000..688634e9 --- /dev/null +++ b/tldr/kiterunner-kb @@ -0,0 +1,42 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kiterunner kb + +> A contextual web scanner for manipulating kitebuilder schemas used in API and web endpoint discovery. +> The `kb` subcommand handles schema compilation, conversion, parsing, and request replay. +> More information: . + +- Compile a kitebuilder schema from JSON to a kite file: + +`kiterunner kb compile {{path/to/wordlist.json}} {{path/to/wordlist.kite}}` + +- Convert a kite file to a text wordlist: + +`kiterunner kb convert {{path/to/wordlist.kite}} {{path/to/wordlist.txt}}` + +- Convert a text wordlist to a kite file: + +`kiterunner kb convert {{path/to/wordlist.txt}} {{path/to/wordlist.kite}}` + +- Convert a kite file to a JSON schema: + +`kiterunner kb convert {{path/to/wordlist.kite}} {{path/to/wordlist.json}}` + +- Parse a kitebuilder schema and output prettified JSON data: + +`kiterunner kb parse {{path/to/wordlist.json}} {{[-o|--output]}} {{json}}` + +- Parse a kite file and output prettified text data: + +`kiterunner kb parse {{path/to/wordlist.kite}} {{[-o|--output]}} {{text}}` + +- Replay a specific request from a kitebuilder schema output: + +`kiterunner kb replay {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}} "{{request_output}}"` + +- Replay a request through a proxy for inspection: + +`kiterunner kb replay {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}} {{[-p|--proxy]}} {{http://localhost:8080}} "{{request_output}}"` diff --git a/tldr/kiterunner-scan b/tldr/kiterunner-scan new file mode 100644 index 00000000..db8ffbbb --- /dev/null +++ b/tldr/kiterunner-scan @@ -0,0 +1,42 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kiterunner scan + +> A contextual web scanner for concurrently scanning API paths and web endpoints using kitebuilder wordlists. +> The `scan` subcommand targets one or multiple hosts with structured API requests. +> More information: . + +- Scan a target with an Assetnote wordlist (e.g., first 5000 API routes): + +`kiterunner scan {{https://example.com}} {{[-A|--assetnote-wordlist]}} {{apiroutes-210228:5000}}` + +- Scan a target with a kitebuilder wordlist: + +`kiterunner scan {{https://example.com}} {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}}` + +- Scan multiple hosts from a file with a kitebuilder wordlist: + +`kiterunner scan {{path/to/hosts.txt}} {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}}` + +- Scan with an Assetnote wordlist and JSON output: + +`kiterunner scan {{https://example.com}} {{[-A|--assetnote-wordlist]}} {{apiroutes-210228:5000}} -o {{json}}` + +- Scan with custom concurrency settings for performance: + +`kiterunner scan {{https://example.com}} {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}} {{[-x|--max-connection-per-host]}} {{5}} {{[-j|--max-parallel-hosts]}} {{100}}` + +- Scan with a wordlist as a normal wordlist, disabling depth scanning: + +`kiterunner scan {{https://example.com}} {{[-w|--kitebuilder-list]}} {{path/to/rafter.txt}} {{[-d|--preflight-depth]}} {{0}}` + +- Scan with custom headers and ignore specific content length responses: + +`kiterunner scan {{https://example.com}} {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}} {{[-H|--header]}} "{{Authorization: Bearer token}}" --ignore-length {{100-105}}` + +- Perform a full kitebuilder scan without phase scanning: + +`kiterunner scan {{https://example.com}} {{[-w|--kitebuilder-list]}} {{path/to/wordlist.kite}} --kitebuilder-full-scan` diff --git a/tldr/kiterunner-wordlist b/tldr/kiterunner-wordlist new file mode 100644 index 00000000..864e5523 --- /dev/null +++ b/tldr/kiterunner-wordlist @@ -0,0 +1,38 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kiterunner wordlist + +> A contextual web scanner for managing wordlists used in API and web endpoint discovery. +> The `wordlist` subcommand handles listing and saving wordlists in `~/.cache/kiterunner`. +> More information: . + +- List all cached and available Assetnote wordlists: + +`kiterunner wordlist list` + +- List wordlists with JSON output: + +`kiterunner wordlist list {{[-o|--output]}} {{json}}` + +- List wordlists with verbose debug output: + +`kiterunner wordlist list {{[-v|--verbose]}} {{debug}}` + +- Save a specific Assetnote wordlist by alias: + +`kiterunner wordlist save {{apiroutes-210328}}` + +- Save a specific Assetnote wordlist by full filename: + +`kiterunner wordlist save {{path/to/httparchive_apiroutes_2024_05_28.txt}}` + +- Save multiple wordlists by alias: + +`kiterunner wordlist save {{apiroutes-210328,aspx-210328}}` + +- Save a wordlist with quiet mode to suppress output: + +`kiterunner wordlist save {{apiroutes-210328}} {{[-q|--quiet]}}` diff --git a/tldr/kr b/tldr/kr new file mode 100644 index 00000000..72f609fe --- /dev/null +++ b/tldr/kr @@ -0,0 +1,12 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kr + +> This command is an alias of `kiterunner`. + +- View documentation for the original command: + +`tldr kiterunner` diff --git a/tldr/nix-build b/tldr/nix-build index f17556c7..8ae878a9 100644 --- a/tldr/nix-build +++ b/tldr/nix-build @@ -5,14 +5,12 @@ source: https://github.com/tldr-pages/tldr.git --- # 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/tldr/nix-build.2 b/tldr/nix-build.2 new file mode 100644 index 00000000..aa0d35c1 --- /dev/null +++ b/tldr/nix-build.2 @@ -0,0 +1,18 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# 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/tldr/nix-build.3 b/tldr/nix-build.3 new file mode 100644 index 00000000..f234c925 --- /dev/null +++ b/tldr/nix-build.3 @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix build + +> Build a Nix expression (downloading from the cache when possible). +> 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`: + +`nix build {{nixpkgs#pkg}}` + +- Build a package from a flake in the current directory, showing the build logs in the process: + +`nix build -L {{.#pkg}}` + +- Build the default package from a flake in some directory: + +`nix build {{./path/to/directory}}` + +- Build a package without making the `result` symlink, instead printing the store path to the `stdout`: + +`nix build --no-link --print-out-paths` diff --git a/tldr/nix-develop b/tldr/nix-develop new file mode 100644 index 00000000..3a0f8d00 --- /dev/null +++ b/tldr/nix-develop @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix develop + +> Run a Bash shell that provides the build environment of a derivation. +> More information: . + +- Start a shell with all dependencies of a package from nixpkgs available: + +`nix develop {{nixpkgs#pkg}}` + +- Start a development shell for the default package in a flake in the current directory: + +`nix develop` + +- In that shell, configure and build the sources: + +`configurePhase; buildPhase` diff --git a/tldr/nix-edit b/tldr/nix-edit new file mode 100644 index 00000000..e3b11570 --- /dev/null +++ b/tldr/nix-edit @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix edit + +> Open the Nix expression of a Nix package in $EDITOR. +> More information: . + +- Open the source of the Nix expression of a package from nixpkgs in your `$EDITOR`: + +`nix edit {{nixpkgs#pkg}}` + +- Dump the source of a package to `stdout`: + +`EDITOR=cat nix edit {{nixpkgs#pkg}}` diff --git a/tldr/nix-flake b/tldr/nix-flake new file mode 100644 index 00000000..b69e6624 --- /dev/null +++ b/tldr/nix-flake @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix flake + +> Manage Nix flakes. +> More information: . + +- Create a new flake (just the `flake.nix` file) from the default template, in the current directory: + +`nix flake init` + +- Update all inputs (dependencies) of the flake in the current directory: + +`nix flake update` + +- Update a specific input (dependency) of the flake in the current directory: + +`nix flake lock --update-input {{input}}` + +- Show all the outputs of a flake on github: + +`nix flake show {{github:owner/repo}}` + +- Display help: + +`nix flake --help` diff --git a/tldr/nix-profile b/tldr/nix-profile new file mode 100644 index 00000000..a4d75c6b --- /dev/null +++ b/tldr/nix-profile @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix profile + +> Install, update and remove packages from Nix profiles. +> More information: . + +- Install some packages from nixpkgs into the default profile: + +`nix profile install {{nixpkgs#pkg1 nixpkgs#pkg2 ...}}` + +- Install a package from a flake on GitHub into a custom profile: + +`nix profile install {{github:owner/repo/pkg}} --profile {{./path/to/directory}}` + +- List packages currently installed in the default profile: + +`nix profile list` + +- Remove a package installed from nixpkgs from the default profile, by name: + +`nix profile remove {{legacyPackages.x86_64-linux.pkg}}` + +- Upgrade packages in the default to the latest available versions: + +`nix profile upgrade` + +- Rollback (cancel) the latest action on the default profile: + +`nix profile rollback` diff --git a/tldr/nix-registry b/tldr/nix-registry new file mode 100644 index 00000000..a96fae1a --- /dev/null +++ b/tldr/nix-registry @@ -0,0 +1,30 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix registry + +> Manage a Nix flake registry. +> See also: `nix flake` for information about flakes. +> More information: . + +- Pin the `nixpkgs` revision to the current version of the upstream repository: + +`nix registry pin {{nixpkgs}}` + +- Pin an entry to the latest version of the branch, or a particular reivision of a GitHub repository: + +`nix registry pin {{entry}} {{github:owner/repo/branch_or_revision}}` + +- Add a new entry that always points to the latest version of a GitHub repository, updating automatically: + +`nix registry add {{entry}} {{github:owner/repo}}` + +- Remove a registry entry: + +`nix registry remove {{entry}}` + +- See documentation about what Nix flake registries are: + +`nix registry --help` diff --git a/tldr/nix-repl b/tldr/nix-repl new file mode 100644 index 00000000..7a2222c4 --- /dev/null +++ b/tldr/nix-repl @@ -0,0 +1,30 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix repl + +> Start an interactive environment for evaluating Nix expressions. +> See for a description of the Nix expression language. +> More information: . + +- Start an interactive environment for evaluating Nix expressions: + +`nix repl` + +- Load all packages from a flake (e.g. `nixpkgs`) into scope: + +`:lf {{nixpkgs}}` + +- Build a package from an expression: + +`:b {{expression}}` + +- Start a shell with package from the expression available: + +`:u {{expression}}` + +- Start a shell with dependencies of the package from the expression available: + +`:s {{expression}}` diff --git a/tldr/nix-run b/tldr/nix-run new file mode 100644 index 00000000..20ca214e --- /dev/null +++ b/tldr/nix-run @@ -0,0 +1,38 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix run + +> Run an application from a Nix flake. +> 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 nix shell`): + +`nix run nixpkgs#{{pkg}}` + +- Run a command with provided arguments: + +`nix run nixpkgs#{{vim}} -- {{path/to/file}}` + +- Run from a remote repository: + +`nix run {{remote_name}}:{{owner}}/{{repo}}` + +- Run from a remote repository using a specific tag, revision or branch: + +`nix run {{remote_name}}:{{owner}}/{{repo}}/{{reference}}` + +- Run from a remote repository specifying a subdirectory and a program: + +`nix run "{{remote_name}}:{{owner}}/{{repo}}?dir={{dir_name}}#{{app}}"` + +- Run the flake of a GitHub pull request: + +`nix run github:{{owner}}/{{repo}}/pull/{{number}}/head` diff --git a/tldr/nix-search b/tldr/nix-search new file mode 100644 index 00000000..b2367530 --- /dev/null +++ b/tldr/nix-search @@ -0,0 +1,22 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix search + +> Search for packages in a Nix flake. +> See also: `nix flake` for information about flakes. +> More information: . + +- Search `nixpkgs` for a package based on its name or description: + +`nix search {{nixpkgs}} {{search_term}}` + +- Show description of a package from nixpkgs: + +`nix search {{nixpkgs#pkg}}` + +- Show all packages available from a flake on github: + +`nix search {{github:owner/repo}}` diff --git a/tldr/nix-shell b/tldr/nix-shell index 1f8f8dab..d87222d6 100644 --- a/tldr/nix-shell +++ b/tldr/nix-shell @@ -5,30 +5,12 @@ source: https://github.com/tldr-pages/tldr.git --- # 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/tldr/nix-shell.2 b/tldr/nix-shell.2 new file mode 100644 index 00000000..c352e917 --- /dev/null +++ b/tldr/nix-shell.2 @@ -0,0 +1,34 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# 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/tldr/nix-shell.3 b/tldr/nix-shell.3 new file mode 100644 index 00000000..e3263c3f --- /dev/null +++ b/tldr/nix-shell.3 @@ -0,0 +1,30 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix shell + +> Start a shell in which the specified packages are available. +> 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`: + +`nix shell {{nixpkgs#pkg1 nixpkgs#packageSet.pkg2 ...}}` + +- Start a shell providing a package from an older version of `nixpkgs` (21.05): + +`nix shell {{nixpkgs/nixos-21.05#pkg}}` + +- Start a shell with the "default package" from a flake in the current directory, printing build logs if any builds happen: + +`nix shell -L` + +- Start a shell with a package from a flake on GitHub: + +`nix shell {{github:owner/repo#pkg}}` + +- Run a command in a shell with a package: + +`nix shell {{nixpkgs#pkg}} -c {{some-cmd --someflag 'Some other arguments'}}` diff --git a/tldr/nix-store b/tldr/nix-store index 67cecd91..af935ea0 100644 --- a/tldr/nix-store +++ b/tldr/nix-store @@ -5,30 +5,12 @@ source: https://github.com/tldr-pages/tldr.git --- # 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/tldr/nix-store.2 b/tldr/nix-store.2 new file mode 100644 index 00000000..9dda2886 --- /dev/null +++ b/tldr/nix-store.2 @@ -0,0 +1,34 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# 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/tldr/nix-store.3 b/tldr/nix-store.3 new file mode 100644 index 00000000..ceacb3db --- /dev/null +++ b/tldr/nix-store.3 @@ -0,0 +1,30 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix store + +> Manipulate the Nix store. +> See also: `nix-store`. +> More information: . + +- Collect garbage, i.e. remove unused paths to reduce space usage: + +`nix store gc` + +- Hard-link identical files together to reduce space usage: + +`nix store optimise` + +- Delete a specific store path (most be unused): + +`nix store delete {{/nix/store/...}}` + +- List a contents of the store path, on a remote store: + +`nix store --store {{https://cache.nixos.org}} ls {{/nix/store/...}}` + +- Show the differences in versions between two store paths, with their respective dependencies: + +`nix store diff-closures {{/nix/store/...}} {{/nix/store/...}}` diff --git a/tldr/nix-why-depends b/tldr/nix-why-depends new file mode 100644 index 00000000..70555684 --- /dev/null +++ b/tldr/nix-why-depends @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nix why-depends + +> Show why a package depends on another package. +> More information: . + +- Show why the currently running NixOS system requires a certain store path: + +`nix why-depends {{/run/current-system}} {{/nix/store/...}}` + +- Show why a package from nixpkgs requires another package as a _build-time_ dependency: + +`nix why-depends --derivation {{nixpkgs#dependent}} {{nixpkgs#dependency}}`