Files
nixpkgs/pkgs/by-name/im/immich-cli/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

63 lines
1.3 KiB
Nix

{
lib,
immich,
jq,
nodejs,
makeWrapper,
stdenv,
}:
let
inherit (immich) pnpm;
in
stdenv.mkDerivation rec {
pname = "immich-cli";
version = "2.2.96";
inherit (immich) src pnpmDeps;
postPatch = ''
local -r cli_version="$(jq -r .version cli/package.json)"
test "$cli_version" = ${version} \
|| (echo "error: update immich-cli version to $cli_version" && exit 1)
'';
nativeBuildInputs = [
jq
makeWrapper
nodejs
pnpm
pnpm.configHook
];
buildPhase = ''
runHook preBuild
pnpm --filter @immich/sdk build
pnpm --filter @immich/cli build
runHook postBuild
'';
installPhase = ''
runHook preInstall
local -r packageOut="$out/lib/node_modules/@immich/cli"
pnpm --filter @immich/cli deploy --prod --no-optional "$packageOut"
makeWrapper '${lib.getExe nodejs}' "$out/bin/immich" \
--add-flags "$packageOut/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";
};
}