|
| 1 | +Extensions are managed in two places: upstream, and this repository. Therefore |
| 2 | +there are two update strategies available. |
| 3 | + |
| 4 | +## Updating extensions in this repository |
| 5 | + |
| 6 | +Assuming that you run `nix develop` to get a development shell, there is a tool |
| 7 | +named `nix-update` that is available: |
| 8 | + |
| 9 | +``` |
| 10 | +austin@GANON:~/work/nix-postgres$ which nix-update |
| 11 | +/nix/store/2jyq6h0ln3f5vlgz2had80l2crdkjmdy-nix-update-0.19.2/bin/nix-update |
| 12 | +``` |
| 13 | + |
| 14 | +Run something like this to update the extension `pg_foobar`: |
| 15 | + |
| 16 | +```bash |
| 17 | +nix-update --flake psql_15/exts/pg_foobar |
| 18 | +git commit -asm "pg_foobar: update to latest release" |
| 19 | +``` |
| 20 | + |
| 21 | +It doesn't matter if you use `psql_14` or `psql_15` here, because `nix-update` |
| 22 | +will look at the _file_ that extension is defined in, in order to update the |
| 23 | +source code. |
| 24 | + |
| 25 | +## Updating extensions upstream |
| 26 | + |
| 27 | +You can use the same tool, `nix-update`, to do this. If you're sitting in the |
| 28 | +root of the nixpkgs repository, try this: |
| 29 | + |
| 30 | +``` |
| 31 | +nix run nixpkgs#nix-update -- postgresqlPackages.pg_foobar |
| 32 | +git commit -asm "pg_foobar: update to latest release" |
| 33 | +``` |
| 34 | + |
| 35 | +Because the tool may not be in your shell by default, we use `nix run` to run it |
| 36 | +for us. |
| 37 | + |
| 38 | +The full list of available names to substitute for `pg_foobar` is available in |
| 39 | +the file |
| 40 | +[pkgs/servers/sql/postgresql/packages.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/packages.nix) |
| 41 | + |
| 42 | +### Updating the Nixpkgs snapshot |
| 43 | + |
| 44 | +Now that your change is merged upstream, you need to update the version of |
| 45 | +`nixpkgs` used in this repository: |
| 46 | + |
| 47 | +- Check the `nixpkgs-unstable` branch: |
| 48 | + https://github.com/nixos/nixpkgs/tree/nixpkgs-unstable |
| 49 | +- Wait until your commit is fast-forwarded and part of that branch |
| 50 | +- Run `nix flake update` |
| 51 | + |
| 52 | +## Release tags versus latest trunk |
| 53 | + |
| 54 | +By default, `nix-update` will update an expression to the latest tagged release. |
| 55 | +No extra arguments are necessary. You can specify an exact release tag using the |
| 56 | +`--version=<xyz>` flag. Using the syntax `--version=branch` means "update to the |
| 57 | +latest version on the default branch." |
| 58 | + |
| 59 | +## Example PRs |
| 60 | + |
| 61 | +- https://github.com/supabase/nix-postgres/pull/9 updates `pg_net` to the latest |
| 62 | + release |
| 63 | +- https://github.com/supabase/nix-postgres/pull/7 updates `pg_hashids` to the |
| 64 | + latest `trunk` tip |
| 65 | + |
| 66 | +## Other notes |
| 67 | + |
| 68 | +See issue [#5](https://github.com/supabase/nix-postgres/issues/5) for more |
| 69 | +information about extension management. |
0 commit comments