summaryrefslogtreecommitdiff
path: root/pkgs/immich-frame/default.nix
blob: 9c2c0f0caba60b7ae2128555c7c633985b40f462 (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
42
43
44
45
46
{
  fetchgit,
  pkgs,
  python3Packages,
  buildNpmPackage,
}:
let
  version = "0.4.1";
  src = fetchgit {
    url = "https://git.tjkeller.xyz/immich-frame";
    tag = "v${version}";
    hash = "sha256-1E//uhk/egkt5y1XMn52EHumdgswxq45bwntNIoCeRM=";
  };

  frontend = buildNpmPackage {
    inherit version src;
    pname = "immich-frame-frontend";

    npmWorkspace = "src/client";
    npmDepsHash = "sha256-/8dHzpqvnDZb+SV9O/GvTyspKLaPDs4vt3QrzoLsyEI=";

    installPhase = ''
      mkdir -p $out
      cp -R dist $out/
    '';
  };
in python3Packages.buildPythonApplication {
  inherit version src;
  pname = "immich-frame";

  makeWrapperArgs = [ "--set" "IMMICH_FRAME_STATIC_WEB_ASSETS" "${frontend}/dist" ];

  pyproject = true;
  build-system = with python3Packages; [ setuptools ];
  propagatedBuildInputs = with python3Packages; [
    flask
    flask-cors  # DEBUG
    flask-socketio
    numpy
    pillow
    platformdirs
    pygame
    pyopengl
    requests
  ];
}