immich-cli: 2.2.15 -> 2.2.19

This commit is contained in:
Jan van Brügge 2024-07-25 20:07:09 +01:00
parent 2900bc2f17
commit f2ff5dc267
No known key found for this signature in database
GPG Key ID: 88E0BF7B7A546481
5 changed files with 53 additions and 78 deletions

View File

@ -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";
};
}

View File

@ -2,14 +2,21 @@
"version": "1.115.0",
"hash": "sha256-H2FCR55redomrDjnnCQys47AaYbWEmlxO5NJEcVMBwY=",
"components": {
"cli": {
"npmDepsHash": "sha256-+zKtPHXjBd1KAKvI5xaY2/9qzVUg+8Ho/wrV9+TlU64=",
"version": "2.2.19"
},
"server": {
"npmDepsHash": "sha256-6CehRhPepspDpQW1h0Bx7EpH7hn42Ygqma/6wim14jA="
"npmDepsHash": "sha256-6CehRhPepspDpQW1h0Bx7EpH7hn42Ygqma/6wim14jA=",
"version": "1.115.0"
},
"web": {
"npmDepsHash": "sha256-ZmXfYktgOmMkDjfqSGyyflr2CmnC9yVnJ1gAcmd6A00="
"npmDepsHash": "sha256-ZmXfYktgOmMkDjfqSGyyflr2CmnC9yVnJ1gAcmd6A00=",
"version": "1.115.0"
},
"open-api/typescript-sdk": {
"npmDepsHash": "sha256-l1mLYFpFQjYxytY0ZWLq+ldUhZA6so0HqPgCABt0s9k="
"npmDepsHash": "sha256-l1mLYFpFQjYxytY0ZWLq+ldUhZA6so0HqPgCABt0s9k=",
"version": "1.115.0"
}
}
}

View File

@ -28,13 +28,17 @@ cat <<EOF > "$sources_tmp"
}
EOF
for npm_component in server web "open-api/typescript-sdk"; do
lock=$(mktemp)
for npm_component in cli server web "open-api/typescript-sdk"; do
echo "fetching $npm_component"
hash=$(prefetch-npm-deps <(curl -s "$upstream_src/$npm_component/package-lock.json"))
curl -s -o "$lock" "$upstream_src/$npm_component/package-lock.json"
hash=$(prefetch-npm-deps "$lock")
echo "$(jq --arg npm_component "$npm_component" \
--arg hash "$hash" \
'.components += {($npm_component): {npmDepsHash: $hash}}' \
--arg version "$(jq -r '.version' <"$lock")" \
'.components += {($npm_component): {npmDepsHash: $hash, version: $version}}' \
"$sources_tmp")" > "$sources_tmp"
done
rm "$lock"
cp "$sources_tmp" sources.json

View File

@ -1,70 +0,0 @@
{ lib
, buildNpmPackage
, fetchFromGitHub
, testers
}:
let
version = "2.2.15";
src = fetchFromGitHub {
owner = "immich-app";
repo = "immich";
# Using a fixed commit until upstream has release tags for cli.
rev = "f7bfde6a3286d4b454c2f05ccf354914f8eccac6";
hash = "sha256-O014Y2HwhfPqKKFFGtNDJBzCaR6ugI4azw6/kfzKET0=";
};
meta' = {
description = "CLI utilities for Immich to help upload images and videos";
homepage = "https://github.com/immich-app/immich";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ felschr pineapplehunter ];
mainProgram = "immich";
};
open-api-typescript-sdk = buildNpmPackage {
pname = "immich-cli-openapi-typescript-sdk";
inherit src version;
npmDepsHash = "sha256-rIN88xw8kdLfhFbT4OReTwzWqNlD4QVAAuvfMyda+V8=";
postPatch = ''
cd open-api/typescript-sdk
'';
meta = {
# using inherit for `builtin.unsafeGetAttrPos` to work correctly
inherit (meta')
description
homepage
license
maintainers;
};
};
immich-cli = buildNpmPackage {
pname = "immich-cli";
inherit src version;
npmDepsHash = "sha256-r/kCE6FmhbnMVv2Z76hH/1O1YEYSq9VY5kB0xlqWzaM=";
postPatch = ''
ln -sv ${open-api-typescript-sdk}/lib/node_modules/@immich/sdk/{build,node_modules} open-api/typescript-sdk
cd cli
'';
passthru = {
inherit open-api-typescript-sdk;
tests.version = testers.testVersion { package = immich-cli; };
};
meta = {
# using inherit for `builtin.unsafeGetAttrPos` to work correctly
inherit (meta')
description
homepage
license
maintainers
mainProgram;
};
};
in
immich-cli

View File

@ -1796,8 +1796,6 @@ with pkgs;
hyperpotamus = callPackage ../tools/misc/hyperpotamus { };
immich-cli = callPackage ../tools/misc/immich-cli { };
inherit (callPackages ../tools/networking/ivpn/default.nix {}) ivpn ivpn-service;
jobber = callPackage ../tools/system/jobber { };