From 235a7310bacde3336198300492f28541a727b7e0 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 22 Mar 2026 00:57:13 +0200 Subject: [PATCH] pkgs/README: explain more accurately passthru.updateScript & r-ryantm --- pkgs/README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/README.md b/pkgs/README.md index 8d6ab6e02353..d4ef5c3faebc 100644 --- a/pkgs/README.md +++ b/pkgs/README.md @@ -906,10 +906,14 @@ stdenv.mkDerivation { ## Automatic package updates [automatic-package-updates]: #automatic-package-updates -Nixpkgs periodically tries to update all packages that have a `passthru.updateScript` attribute. +The [community bot `r-ryantm`](https://nix-community.org/update-bot/), periodically tries to update all packages in Nixpkgs. +`r-ryantm` runs the program [`nixpkgs-update`](https://nix-community.github.io/nixpkgs-update/) to find new versions of packages. +In most cases, `nixpkgs-update` will be capable of finding new versions and perform the update with out any special instructions. +Putting a `passthru.updateScript` attribute sets an explicit update procedure for `nixpkgs-update`, but this is not required for most cases. +To learn more about the default update procedures, read their [FAQ for Nixpkgs maintainers](https://nix-community.github.io/nixpkgs-update/nixpkgs-maintainer-faq/). > [!Note] -> A common pattern is to use the [`nix-update-script`](../pkgs/by-name/ni/nix-update/nix-update-script.nix) attribute provided in Nixpkgs, which runs [`nix-update`](https://github.com/Mic92/nix-update): +> A common pattern is to use the [`nix-update-script`](../pkgs/by-name/ni/nix-update/nix-update-script.nix) function provided in Nixpkgs, which makes automatic updates use [`nix-update`](https://github.com/Mic92/nix-update): > > ```nix > { stdenv, nix-update-script }: @@ -919,9 +923,10 @@ Nixpkgs periodically tries to update all packages that have a `passthru.updateSc > } > ``` > -> For simple packages, this is often enough, and will ensure that the package is updated automatically by [`nixpkgs-update`](https://github.com/nix-community/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). +> `nix-update` is a little bit more flexible than `nixpkgs-update` in performing updates, so it can be useful for cases such as: +> +> - A `nix-update` CLI flag like `--version branch` or `--version-regex` are needed to make the update work. +> - You don't want to rely upon new versions to be listed in [Repology](https://repology.org/), and `nix-update` finds new versions easily (e.g GitLab projects). The `passthru.updateScript` attribute can contain one of the following: