immich: use finalAttrs.src for all immich derivations (#460603)
This commit is contained in:
@@ -446,7 +446,7 @@ in
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
inherit (cfg.machine-learning) environment;
|
inherit (cfg.machine-learning) environment;
|
||||||
serviceConfig = commonServiceConfig // {
|
serviceConfig = commonServiceConfig // {
|
||||||
ExecStart = lib.getExe (cfg.package.machine-learning.override { immich = cfg.package; });
|
ExecStart = lib.getExe cfg.package.machine-learning;
|
||||||
Slice = "system-immich.slice";
|
Slice = "system-immich.slice";
|
||||||
CacheDirectory = "immich";
|
CacheDirectory = "immich";
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
pnpm = pnpm_10;
|
pnpm = pnpm_10;
|
||||||
version = "2.2.3";
|
|
||||||
|
|
||||||
esbuild' = buildPackages.esbuild.override {
|
esbuild' = buildPackages.esbuild.override {
|
||||||
buildGoModule =
|
buildGoModule =
|
||||||
@@ -104,58 +103,29 @@ let
|
|||||||
echo "${date}" > $out/geodata-date.txt
|
echo "${date}" > $out/geodata-date.txt
|
||||||
'';
|
'';
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "immich-app";
|
|
||||||
repo = "immich";
|
|
||||||
tag = "v${version}";
|
|
||||||
hash = "sha256-OoToTRDPXWOa7d1j1xvkZt+vKWBX4eHDiIsFs3bIlvw=";
|
|
||||||
};
|
|
||||||
|
|
||||||
pnpmDeps = pnpm.fetchDeps {
|
|
||||||
pname = "immich";
|
|
||||||
inherit version src;
|
|
||||||
fetcherVersion = 2;
|
|
||||||
hash = "sha256-igkO0ID0/9uPtFAXL2v5bcFbCpZK2lcYEctWBKtFKdU=";
|
|
||||||
};
|
|
||||||
|
|
||||||
web = stdenv.mkDerivation {
|
|
||||||
pname = "immich-web";
|
|
||||||
inherit version src pnpmDeps;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
nodejs
|
|
||||||
pnpm
|
|
||||||
pnpm.configHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
runHook preBuild
|
|
||||||
|
|
||||||
pnpm --filter @immich/sdk build
|
|
||||||
pnpm --filter immich-web build
|
|
||||||
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
cd web
|
|
||||||
cp -r build $out
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Without this thumbnail generation for raw photos fails with
|
# Without this thumbnail generation for raw photos fails with
|
||||||
# Error: Input file has corrupt header: tiff2vips: samples_per_pixel not a whole number of bytes
|
# Error: Input file has corrupt header: tiff2vips: samples_per_pixel not a whole number of bytes
|
||||||
vips' = vips.overrideAttrs (prev: {
|
vips' = vips.overrideAttrs (prev: {
|
||||||
mesonFlags = prev.mesonFlags ++ [ "-Dtiff=disabled" ];
|
mesonFlags = prev.mesonFlags ++ [ "-Dtiff=disabled" ];
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "immich";
|
pname = "immich";
|
||||||
inherit version src pnpmDeps;
|
version = "2.2.3";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "immich-app";
|
||||||
|
repo = "immich";
|
||||||
|
tag = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-OoToTRDPXWOa7d1j1xvkZt+vKWBX4eHDiIsFs3bIlvw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
pnpmDeps = pnpm.fetchDeps {
|
||||||
|
pname = "immich";
|
||||||
|
inherit (finalAttrs) version src;
|
||||||
|
fetcherVersion = 2;
|
||||||
|
hash = "sha256-igkO0ID0/9uPtFAXL2v5bcFbCpZK2lcYEctWBKtFKdU=";
|
||||||
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# pg_dumpall fails without database root access
|
# pg_dumpall fails without database root access
|
||||||
@@ -225,7 +195,7 @@ stdenv.mkDerivation {
|
|||||||
\) -exec rm -r {} +
|
\) -exec rm -r {} +
|
||||||
|
|
||||||
mkdir -p "$packageOut/build"
|
mkdir -p "$packageOut/build"
|
||||||
ln -s '${web}' "$packageOut/build/www"
|
ln -s '${finalAttrs.passthru.web}' "$packageOut/build/www"
|
||||||
ln -s '${geodata}' "$packageOut/build/geodata"
|
ln -s '${geodata}' "$packageOut/build/geodata"
|
||||||
|
|
||||||
echo '${builtins.toJSON buildLock}' > "$packageOut/build/build-lock.json"
|
echo '${builtins.toJSON buildLock}' > "$packageOut/build/build-lock.json"
|
||||||
@@ -254,18 +224,47 @@ stdenv.mkDerivation {
|
|||||||
inherit (nixosTests) immich immich-vectorchord-migration immich-vectorchord-reindex;
|
inherit (nixosTests) immich immich-vectorchord-migration immich-vectorchord-reindex;
|
||||||
};
|
};
|
||||||
|
|
||||||
machine-learning = immich-machine-learning;
|
machine-learning = immich-machine-learning.override {
|
||||||
|
immich = finalAttrs.finalPackage;
|
||||||
|
};
|
||||||
|
|
||||||
|
web = stdenv.mkDerivation {
|
||||||
|
pname = "immich-web";
|
||||||
|
inherit (finalAttrs) version src pnpmDeps;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
nodejs
|
||||||
|
pnpm
|
||||||
|
pnpm.configHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
pnpm --filter @immich/sdk build
|
||||||
|
pnpm --filter immich-web build
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
cd web
|
||||||
|
cp -r build $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
src
|
|
||||||
web
|
|
||||||
geodata
|
geodata
|
||||||
pnpm
|
pnpm
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
changelog = "https://github.com/immich-app/immich/releases/tag/${src.tag}";
|
changelog = "https://github.com/immich-app/immich/releases/tag/${finalAttrs.src.tag}";
|
||||||
description = "Self-hosted photo and video backup solution";
|
description = "Self-hosted photo and video backup solution";
|
||||||
homepage = "https://immich.app/";
|
homepage = "https://immich.app/";
|
||||||
license = with lib.licenses; [
|
license = with lib.licenses; [
|
||||||
@@ -281,4 +280,4 @@ stdenv.mkDerivation {
|
|||||||
platforms = lib.platforms.linux ++ lib.platforms.freebsd;
|
platforms = lib.platforms.linux ++ lib.platforms.freebsd;
|
||||||
mainProgram = "server";
|
mainProgram = "server";
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user