forgejo,forgejo-lts: fix passthru.updateScript

`nix-update` is unable to detect that the hashes are in `packages.nix`
and `lts.nix` instead of `generic.nix` (where the `.src` attribute lies)
respectively.

`nix-update` provides a `--override-filename` flag to override that
heuristic, so we use that.

Additionally, scope `lts.nix` to the 7.x version series by using
`--version-regex`.
This commit is contained in:
emilylange 2024-08-09 18:12:44 +02:00
parent 0c4a828b0d
commit 31d5838761
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87
3 changed files with 12 additions and 1 deletions

View File

@ -3,6 +3,7 @@
, hash
, npmDepsHash
, vendorHash
, nixUpdateExtraArgs ? [ ]
}:
{ bash
@ -154,7 +155,7 @@ buildGoModule rec {
'';
tests = if lts then nixosTests.forgejo-lts else nixosTests.forgejo;
updateScript = nix-update-script { };
updateScript = nix-update-script { extraArgs = nixUpdateExtraArgs; };
};
meta = {

View File

@ -4,4 +4,10 @@ import ./generic.nix {
npmDepsHash = "sha256-OqtYRjftwGxgW1JgMxyWd+9DndpEkd3LdQHSECc40yU=";
vendorHash = "sha256-hfbNyCQMQzDzJxFc2MPAR4+v/qNcnORiQNbwbbIA4Nw=";
lts = true;
nixUpdateExtraArgs = [
"--version-regex"
"v(7\.[0-9.]+)"
"--override-filename"
"pkgs/by-name/fo/forgejo/lts.nix"
];
}

View File

@ -4,4 +4,8 @@ import ./generic.nix {
npmDepsHash = "sha256-6AMaZadgcTvOBsIXJjZQB6Q1rkdn+R82pclXdVvtdWY=";
vendorHash = "sha256-tNb0tCf+gjUmUqrjkzt7Wqqz21hW9WRh8CEdX8rv8Do=";
lts = false;
nixUpdateExtraArgs = [
"--override-filename"
"pkgs/by-name/fo/forgejo/package.nix"
];
}