Unverified Commit 31d58387 authored by emilylange's avatar emilylange
Browse files

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`.
parent 0c4a828b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 = {
+6 −0
Original line number Diff line number Diff line
@@ -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"
  ];
}
+4 −0
Original line number Diff line number Diff line
@@ -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"
  ];
}