depot/third_party/nixpkgs/pkgs/servers/ariang/default.nix
Default email c7e6337bd0 Project import generated by Copybara.
GitOrigin-RevId: 08e4dc3a907a6dfec8bb3bbf1540d8abbffea22b
2023-04-29 12:46:19 -04:00

61 lines
1.3 KiB
Nix

{ lib
, stdenv
, pkgs
, fetchFromGitHub
, nodejs ? pkgs.nodejs_14
}:
stdenv.mkDerivation rec {
pname = "ariang";
version = "1.3.3";
src = fetchFromGitHub {
owner = "mayswind";
repo = "AriaNg";
rev = version;
hash = "sha256-kh2XdsrZhR0i+vUhTrzXu5z5Ahv9otNEEjqlCUnVmqE=";
};
buildPhase =
let
nodePackages = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
nodeDependencies = (nodePackages.shell.override (old: {
# access to path '/nix/store/...-source' is forbidden in restricted mode
src = src;
# Error: Cannot find module '/nix/store/...-node-dependencies
dontNpmInstall = true;
})).nodeDependencies;
in
''
runHook preBuild
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
${nodeDependencies}/bin/gulp clean build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share
cp -r dist $out/share/ariang
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "a modern web frontend making aria2 easier to use";
homepage = "http://ariang.mayswind.net/";
license = licenses.mit;
maintainers = with maintainers; [ stunkymonkey ];
platforms = platforms.unix;
};
}