about summary refs log tree commit diff
path: root/nixos/doc/manual/configuration
diff options
context:
space:
mode:
authorx10an14 <x10an14@users.noreply.github.com>2023-06-06 22:37:42 +0200
committerGitHub <noreply@github.com>2023-06-06 22:37:42 +0200
commitdc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d (patch)
tree703a42d9a36efc5dc0e4d1ff58a96e73f7173db3 /nixos/doc/manual/configuration
parent7efb781c3a9d96f1c0a69f3b0507b74f0632151e (diff)
downloadnixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.tar
nixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.tar.gz
nixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.tar.bz2
nixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.tar.lz
nixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.tar.xz
nixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.tar.zst
nixlib-dc7d4dece5b16e2ea9f2524dd2a14eb88d17a88d.zip
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>
Diffstat (limited to 'nixos/doc/manual/configuration')
-rw-r--r--nixos/doc/manual/configuration/customizing-packages.section.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/doc/manual/configuration/customizing-packages.section.md b/nixos/doc/manual/configuration/customizing-packages.section.md
index bceeeb2d7a16..709a07b09cea 100644
--- a/nixos/doc/manual/configuration/customizing-packages.section.md
+++ b/nixos/doc/manual/configuration/customizing-packages.section.md
@@ -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