about summary refs log tree commit diff
path: root/pkgs/applications/office/documenso/default.nix
blob: cca2c86c55844c27ed61a7ba29ca3ace855dfb20 (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
51
52
53
{ lib
, fetchFromGitHub
, buildNpmPackage
, nodePackages
, nix-update-script
}:
let
  version = "0.9";
in
buildNpmPackage {
  pname = "documenso";
  inherit version;

  src = fetchFromGitHub {
    owner = "documenso";
    repo = "documenso";
    rev = "v${version}";
    hash = "sha256-uKOJVZ0GRHo/CYvd/Ix/tq1WDhutRji1tSGdcITsNlo=";
  };

  preBuild = ''
    # somehow for linux, npm is not finding the prisma package with the
    # packages installed with the lockfile.
    # This generates a prisma version incompatibility warning and is a kludge
    # until the upstream package-lock is modified.
    ${nodePackages.prisma}/bin/prisma generate
  '';

  npmDepsHash = "sha256-+JbvFMi8xoyxkuL9k96K1Vq0neciCGkkyZUPd15ES2E=";

  installPhase = ''
    runHook preInstall

    mkdir $out
    cp -r node_modules $out/
    cp package-lock.json $out
    cp apps/web/package.json $out
    cp -r apps/web/public $out/
    cp -r apps/web/.next $out/

    runHook postInstall
  '';

  passthru.updateScript = nix-update-script {};

  meta = with lib; {
    description = "Open Source DocuSign Alternative";
    homepage = "https://github.com/documenso/documenso";
    license = licenses.agpl3Only;
    maintainers = with maintainers; [ happysalada ];
    platforms = platforms.unix;
  };
}