forgejo: refactor to support multiple versions

This commit is contained in:
emilylange 2024-07-31 03:59:07 +02:00
parent f3bffa8c62
commit a2e9da2c40
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87
3 changed files with 29 additions and 16 deletions

View File

@ -1,3 +1,10 @@
{ lts ? false
, version
, hash
, npmDepsHash
, vendorHash
}:
{ bash
, brotli
, buildGoModule
@ -20,11 +27,17 @@
}:
let
src = fetchFromGitea {
domain = "codeberg.org";
owner = "forgejo";
repo = "forgejo";
rev = "v${version}";
inherit hash;
};
frontend = buildNpmPackage {
pname = "forgejo-frontend";
inherit (forgejo) src version;
npmDepsHash = "sha256-Nu9aOjJpEAuCWWnJfZXy/GayiUDiyc3hOu6Bx7GxfxA=";
inherit src version npmDepsHash;
patches = [
./package-json-npm-build-frontend.patch
@ -38,18 +51,13 @@ let
};
in
buildGoModule rec {
pname = "forgejo";
version = "7.0.5";
pname = "forgejo" + lib.optionalString lts "-lts";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "forgejo";
repo = "forgejo";
rev = "v${version}";
hash = "sha256-Y/Ita5dr3COACffAIAjcqHHcdKiUWWEb/f/MPzMG200=";
};
vendorHash = "sha256-hfbNyCQMQzDzJxFc2MPAR4+v/qNcnORiQNbwbbIA4Nw=";
inherit
version
src
vendorHash
;
subPackages = [ "." "contrib/environment-to-ini" ];

View File

@ -0,0 +1,7 @@
import ./generic.nix {
version = "7.0.5";
hash = "sha256-Y/Ita5dr3COACffAIAjcqHHcdKiUWWEb/f/MPzMG200=";
npmDepsHash = "sha256-Nu9aOjJpEAuCWWnJfZXy/GayiUDiyc3hOu6Bx7GxfxA=";
vendorHash = "sha256-hfbNyCQMQzDzJxFc2MPAR4+v/qNcnORiQNbwbbIA4Nw=";
lts = false;
}

View File

@ -2193,8 +2193,6 @@ with pkgs;
diff-so-fancy = callPackage ../applications/version-management/diff-so-fancy { };
forgejo = callPackage ../by-name/fo/forgejo/generic.nix { };
gex = callPackage ../applications/version-management/gex {
inherit (darwin.apple_sdk.frameworks) Security;
};