about summary refs log tree commit diff
path: root/pkgs/by-name/im/immich-cli/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/im/immich-cli/package.nix')
-rw-r--r--pkgs/by-name/im/immich-cli/package.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/by-name/im/immich-cli/package.nix b/pkgs/by-name/im/immich-cli/package.nix
new file mode 100644
index 000000000000..d41dc764f26d
--- /dev/null
+++ b/pkgs/by-name/im/immich-cli/package.nix
@@ -0,0 +1,36 @@
+{
+  lib,
+  immich,
+  buildNpmPackage,
+  nodejs,
+  makeWrapper,
+}:
+buildNpmPackage {
+  pname = "immich-cli";
+  src = "${immich.src}/cli";
+  inherit (immich.sources.components.cli) version npmDepsHash;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  inherit (immich.web) preBuild;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    mv package.json package-lock.json node_modules dist $out/
+
+    makeWrapper ${lib.getExe nodejs} $out/bin/immich --add-flags $out/dist/index.js
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Self-hosted photo and video backup solution (command line interface)";
+    homepage = "https://immich.app/docs/features/command-line-interface";
+    license = lib.licenses.agpl3Only;
+    maintainers = with lib.maintainers; [ jvanbruegge ];
+    inherit (nodejs.meta) platforms;
+    mainProgram = "immich";
+  };
+}