diff --git a/pkgs/by-name/au/autobrr/package.nix b/pkgs/by-name/au/autobrr/package.nix new file mode 100644 index 0000000000000..4c3191883d05d --- /dev/null +++ b/pkgs/by-name/au/autobrr/package.nix @@ -0,0 +1,55 @@ +{ lib, cacert, buildGoModule, fetchFromGitHub, stdenvNoCC, nix-update-script +, nodejs, nodePackages, pnpm_9, typescript }: + +let + pname = "autobrr"; + version = "1.51.0"; + src = fetchFromGitHub { + owner = "autobrr"; + repo = "autobrr"; + rev = "v${version}"; + hash = "sha256-Q0rh/+m0DK/F9NdbzAbg9A5mqC2brPp/plLi/w9F0TE="; + }; + + autobrr-web = stdenvNoCC.mkDerivation { + pname = "${pname}-web"; + inherit src version; + + nativeBuildInputs = [ nodejs pnpm_9.configHook typescript ]; + + sourceRoot = "${src.name}/web"; + + pnpmDeps = pnpm_9.fetchDeps { + inherit (autobrr-web) pname version src sourceRoot; + hash = "sha256-TcfxE18nkOSxa4UG2euK1hViPw8tY0TS6tayGJsNNog="; + }; + + postBuild = '' + pnpm run build + ''; + + installPhase = '' + cp -r dist $out + ''; + }; +in buildGoModule rec { + inherit autobrr-web pname version src; + + vendorHash = "sha256-6KmzsaYgGXA1B1+gaD0I9/zPmdA2JesisfGMjO4E4qc="; + + preBuild = "cp -r ${autobrr-web}/* web/dist"; + + ldflags = + [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" ]; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = + "Modern, easy to use download automation for torrents and usenet"; + license = licenses.gpl2Plus; + homepage = "https://autobrr.com/"; + maintainers = with maintainers; [ av-gal ]; + mainProgram = "autobrr"; + }; +}