summaryrefslogtreecommitdiff
path: root/overlays/etesync-web.nix
blob: 2d4c23eadcfbe80c961dd45730733e6fdccd8fca (plain)
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
{ final, prev, ... }: {
  etesync-web = final.mkYarnPackage rec {
    pname = "etesync-web";
    version = "0.6.1";

    patches = [
      (final.fetchpatch {
        name = "fix-server-url-usage.patch";
        url = "https://github.com/etesync/etesync-web/commit/7a03f8c69c12527d537ce9cb012a5e86a578aa9d.patch";
        hash = "sha256-qPwV+K3jiqAXZl2gYMzcNIcuG0raOyX/YjRWd7/5kU8=";
      })
    ];

    src = final.fetchFromGitHub {
      owner = "etesync";
      repo = "etesync-web";
      rev = "v${version}";
      hash = "sha256-ZQpbeEIDj7cB0Y62uIw3qSClvwE4buVKh6ZPMfS53dY=";
    };

    buildPhase = ''
      runHook preBuild

      REACT_APP_DEFAULT_API_PATH=https://etesync.yggdrasil.li \
        NODE_OPTIONS=--openssl-legacy-provider \
        yarn --offline build

      runHook postBuild
    '';

    installPhase = ''
      runHook preInstall

      cp -r deps/etesync-web/build $out

      runHook postInstall
    '';

    distPhase = "true";
  };
}