-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
} |