about summary refs log tree commit diff
path: root/pkgs/servers/psitransfer/default.nix
blob: e39ae107217e6351080ff115c8afea7fc46c8df9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, buildNpmPackage
, fetchFromGitHub
}:

let
  pname = "psitransfer";
  version = "2.1.2";
  src = fetchFromGitHub {
    owner = "psi-4ward";
    repo = "psitransfer";
    rev = "v${version}";
    hash = "sha256-dBAieXIwCEstR9m+6+2/OLPKo2qHynZ1t372Il0mkXk=";
  };
  app = buildNpmPackage {
    pname = "${pname}-app";
    inherit version src;

    npmDepsHash = "sha256-iCd+I/aTMwQqAMRHan3T191XNz4S3Cy6CDxSLIYY7IA=";

    postPatch = ''
      # https://github.com/psi-4ward/psitransfer/pull/284
      touch public/app/.npmignore
      cd app
    '';

    installPhase = ''
      cp -r ../public/app $out
    '';
  };
in buildNpmPackage {
  inherit pname version src;

  npmDepsHash = "sha256-H22T5IU8bjbsWhwhchDqppvYfcatbXSWqp6gdoek1Z8=";

  postPatch = ''
    rm -r public/app
    cp -r ${app} public/app
  '';

  dontBuild = true;

  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 ];
    mainProgram = "psitransfer";
  };
}