summary refs log tree commit diff
path: root/pkgs/applications/video/frigate/web.nix
blob: 01a3e70b436f169c2fe1d6ec053a86aca40fedf9 (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
{ buildNpmPackage
, src
, version
}:

buildNpmPackage {
  pname = "frigate-web";
  inherit version src;

  sourceRoot = "${src.name}/web";

  postPatch = ''
    substituteInPlace package.json \
      --replace "--base=/BASE_PATH/" ""

    substituteInPlace src/routes/Storage.jsx \
      --replace "/media/frigate" "/var/lib/frigate" \
      --replace "/tmp/cache" "/var/cache/frigate"
  '';

  npmDepsHash = "sha256-fvRxpQjSEzd2CnoEOVgQcB6MJJ4dcjN8bOaacHjCdwU=";

  installPhase = ''
    cp -rv dist/ $out
  '';
}