summary refs log tree commit diff
path: root/pkgs/servers/psitransfer/default.nix
blob: d1d1e13d1b83dc6c3c3f3349b6ac028fcb00751c (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
# To update package version:
#   1. Change version string in node-package.json and this file
#   2. Run `./generate.sh` to rebuild node dependencies with node2nix
#   3. Build this package `nix-build -A psitransfer`
#   4. Profit

{ stdenv
, pkgs
, lib
, nodejs
, fetchzip
}:

let
  nodePackages = import ./node-composition.nix {
    inherit pkgs nodejs;
    inherit (stdenv.hostPlatform) system;
  };

  psitransfer = lib.head (lib.attrValues nodePackages);

  combined = psitransfer.override rec {
    # version is not defined in source package.json
    # version must also be maintained in node-packages.json for node2nix
    version = "2.0.1";

    # override node2nix package src to pull pre-built release of same version
    src = fetchzip {
      url = "https://github.com/psi-4ward/psitransfer/releases/download/v${version}/psitransfer-v${version}.tar.gz";
      sha256 = "mfldWTVmfcIRa+1g8YDnQqem5YmrFRfCxJoitWcXvns=";
      stripRoot = false;
    };

    meta = with lib; {
      homepage = "https://github.com/psi-4ward/psitransfer";
      description = "Simple open source self-hosted file sharing solution";
      license = licenses.bsd2;
      maintainers = with maintainers; [ hyshka ];
    };
  };
in
  combined