about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorNick Hu <me@nickhu.co.uk>2023-08-14 12:58:40 +0100
committerNick Hu <me@nickhu.co.uk>2023-08-15 10:13:39 +0100
commitae8aba3836997fb10ea49cd0ae58d555d22aa397 (patch)
tree006567cd98dab63c57f07e97c56c74ce9554ec5a /doc
parent6e68daefde56a7a8e6fe7c3ca9ceeb436294bb9f (diff)
doc/stdenv/stdenv.chapter.md: add information about nix-update-script and nixpkgs-update
Diffstat (limited to 'doc')
-rw-r--r--doc/stdenv/stdenv.chapter.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md
index 4e8559467f523..56843467fa4a6 100644
--- a/doc/stdenv/stdenv.chapter.md
+++ b/doc/stdenv/stdenv.chapter.md
@@ -425,6 +425,16 @@ A script to be run by `maintainers/scripts/update.nix` when the package is match
   };
   ```
 
+::: {.tip}
+A common pattern is to use the [`nix-update-script`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/common-updater/nix-update.nix) attribute provided in Nixpkgs, which runs [`nix-update`](https://github.com/Mic92/nix-update):
+
+```nix
+passthru.updateScript = nix-update-script { };
+```
+
+For simple packages, this is often enough, and will ensure that the package is updated automatically by [`nixpkgs-update`](https://ryantm.github.io/nixpkgs-update) when a new version is released. The [update bot](https://nix-community.org/update-bot) runs periodically to attempt to automatically update packages, and will run `passthru.updateScript` if set. While not strictly necessary if the project is listed on [Repology](https://repology.org), using `nix-update-script` allows the package to update via many more sources (e.g. GitHub releases).
+:::
+
 ##### How update scripts are executed? {#var-passthru-updateScript-execution}
 
 Update scripts are to be invoked by `maintainers/scripts/update.nix` script. You can run `nix-shell maintainers/scripts/update.nix` in the root of Nixpkgs repository for information on how to use it. `update.nix` offers several modes for selecting packages to update (e.g. select by attribute path, traverse Nixpkgs and filter by maintainer, etc.), and it will execute update scripts for all matched packages that have an `updateScript` attribute.