2023-07-25 19:03:58 +00:00
|
|
|
{ lib
|
|
|
|
, buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
2024-04-27 10:51:59 +00:00
|
|
|
, pkg-config
|
|
|
|
, vips
|
2021-11-25 15:12:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-07-25 19:03:58 +00:00
|
|
|
pname = "psitransfer";
|
2024-04-27 10:51:59 +00:00
|
|
|
version = "2.2.0";
|
2023-07-25 19:03:58 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "psi-4ward";
|
|
|
|
repo = "psitransfer";
|
|
|
|
rev = "v${version}";
|
2024-04-27 10:51:59 +00:00
|
|
|
hash = "sha256-5o4QliAXgSZekIy0CNWfEuOxNl0uetL8C8RKUJ8HsNA=";
|
2023-07-25 19:03:58 +00:00
|
|
|
};
|
|
|
|
app = buildNpmPackage {
|
|
|
|
pname = "${pname}-app";
|
|
|
|
inherit version src;
|
|
|
|
|
2024-04-27 10:51:59 +00:00
|
|
|
npmDepsHash = "sha256-q7E+osWIf6VZ3JvxCXoZYeF28aMgmKP6EzQkksUUjeY=";
|
2023-07-25 19:03:58 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/psi-4ward/psitransfer/pull/284
|
|
|
|
touch public/app/.npmignore
|
|
|
|
cd app
|
|
|
|
'';
|
2022-03-28 21:06:29 +00:00
|
|
|
|
2023-07-25 19:03:58 +00:00
|
|
|
installPhase = ''
|
|
|
|
cp -r ../public/app $out
|
|
|
|
'';
|
2021-11-25 15:12:03 +00:00
|
|
|
};
|
2023-07-25 19:03:58 +00:00
|
|
|
in buildNpmPackage {
|
|
|
|
inherit pname version src;
|
|
|
|
|
2024-04-27 10:51:59 +00:00
|
|
|
npmDepsHash = "sha256-EW/Fej58LE/nbJomPtWvEjDveAUdo0jIWwC+ziN0gy0=";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [
|
|
|
|
vips # for 'sharp' dependency
|
|
|
|
];
|
2023-07-25 19:03:58 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -r public/app
|
|
|
|
cp -r ${app} public/app
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
2021-11-25 15:12:03 +00:00
|
|
|
|
2023-07-25 19:03:58 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/psi-4ward/psitransfer";
|
|
|
|
description = "Simple open source self-hosted file sharing solution";
|
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
maintainers = with lib.maintainers; [ hyshka ];
|
2023-11-23 21:09:35 +00:00
|
|
|
mainProgram = "psitransfer";
|
2021-11-25 15:12:03 +00:00
|
|
|
};
|
2023-07-25 19:03:58 +00:00
|
|
|
}
|