nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
5 pkg-config,
6 vips,
7}:
8
9let
10 pname = "psitransfer";
11 version = "2.2.0";
12 src = fetchFromGitHub {
13 owner = "psi-4ward";
14 repo = "psitransfer";
15 rev = "v${version}";
16 hash = "sha256-5o4QliAXgSZekIy0CNWfEuOxNl0uetL8C8RKUJ8HsNA=";
17 };
18 app = buildNpmPackage {
19 pname = "${pname}-app";
20 inherit version src;
21
22 npmDepsHash = "sha256-q7E+osWIf6VZ3JvxCXoZYeF28aMgmKP6EzQkksUUjeY=";
23
24 postPatch = ''
25 # https://github.com/psi-4ward/psitransfer/pull/284
26 touch public/app/.npmignore
27 cd app
28 '';
29
30 installPhase = ''
31 cp -r ../public/app $out
32 '';
33 };
34in
35buildNpmPackage {
36 inherit pname version src;
37
38 npmDepsHash = "sha256-EW/Fej58LE/nbJomPtWvEjDveAUdo0jIWwC+ziN0gy0=";
39
40 nativeBuildInputs = [ pkg-config ];
41 buildInputs = [
42 vips # for 'sharp' dependency
43 ];
44
45 postPatch = ''
46 rm -r public/app
47 cp -r ${app} public/app
48 '';
49
50 dontBuild = true;
51
52 meta = {
53 homepage = "https://github.com/psi-4ward/psitransfer";
54 description = "Simple open source self-hosted file sharing solution";
55 license = lib.licenses.bsd2;
56 maintainers = with lib.maintainers; [ hyshka ];
57 mainProgram = "psitransfer";
58 };
59}