-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fa74a5
commit b2349e3
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
lib, | ||
buildNpmPackage, | ||
fetchFromGitHub, | ||
nix-update-script, | ||
nodejs, | ||
}: | ||
buildNpmPackage rec { | ||
pname = "immich-public-proxy"; | ||
version = "1.5.4"; | ||
src = fetchFromGitHub { | ||
owner = "alangrainger"; | ||
repo = "immich-public-proxy"; | ||
rev = "v${version}"; | ||
hash = "sha256-GoAUR8s2tRHpXD/yk42u6DDvkI97XAUlF9Zsq8pb/1M="; | ||
}; | ||
|
||
sourceRoot = "${src.name}/app"; | ||
|
||
npmDepsHash = "sha256-BN7g+31ijH8r9rsv5zzjnE8PT7ozAswoyZNJ0XqXGyw="; | ||
|
||
# patch in absolute nix store paths so the process doesn't need to cwd in $out | ||
postPatch = '' | ||
substituteInPlace src/index.ts --replace-fail \ | ||
"const app = express()" \ | ||
"const app = express() | ||
// Set the views path to the nix output | ||
app.set('views', '$out/lib/node_modules/immich-public-proxy/views')" \ | ||
--replace-fail \ | ||
"static('public'" \ | ||
"static('$out/lib/node_modules/immich-public-proxy/public'" | ||
''; | ||
|
||
passthru = { | ||
updateScript = nix-update-script { }; | ||
}; | ||
|
||
meta = { | ||
description = "Share your Immich photos and albums in a safe way without exposing your Immich instance to the public"; | ||
homepage = "https://github.com/alangrainger/immich-public-proxy"; | ||
license = lib.licenses.agpl3Only; | ||
maintainers = with lib.maintainers; [ jaculabilis ]; | ||
inherit (nodejs.meta) platforms; | ||
mainProgram = "immich-public-proxy"; | ||
}; | ||
} |