Document how to use packages with extensions. (#145011)

Co-authored-by: Artturi <Artturin@artturin.com>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
x10an14 2023-06-06 22:37:42 +02:00 committed by GitHub
parent 7efb781c3a
commit dc7d4dece5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,29 @@ Unfortunately, Nixpkgs currently lacks a way to query available
configuration options.
:::
::: {.note}
Alternatively, many packages come with extensions one might add.
Examples include:
- [`passExtensions.pass-otp`](https://search.nixos.org/packages/query=passExtensions.pass-otp)
- [`python310Packages.requests`](https://search.nixos.org/packages/query=python310Packages.requests)
You can use them like this:
```nix
environment.systemPackages = with pkgs; [
sl
(pass.withExtensions (subpkgs: with subpkgs; [
pass-audit
pass-otp
pass-genphrase
]))
(python3.withPackages (subpkgs: with subpkgs; [
requests
]))
cowsay
];
```
:::
Apart from high-level options, it's possible to tweak a package in
almost arbitrary ways, such as changing or disabling dependencies of a
package. For instance, the Emacs package in Nixpkgs by default has a