mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
parent
471ea87020
commit
3f5f280ee8
1 changed files with 21 additions and 28 deletions
|
|
@ -3,68 +3,61 @@
|
|||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
nodejs,
|
||||
pnpm_9,
|
||||
fetchPnpmDeps,
|
||||
pnpmConfigHook,
|
||||
fetchNpmDeps,
|
||||
npmHooks,
|
||||
go-task,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "immich-kiosk";
|
||||
version = "0.31.0";
|
||||
version = "0.39.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "damongolding";
|
||||
repo = "immich-kiosk";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-PHdHhhVy0RWMFzR4ZEyWLOiRYHROadLiPIdqkUZMTow=";
|
||||
hash = "sha256-kdTEvH8MqL3oXe0QZlPTVpeByLpqAdNfPGfu5f2G6g0=";
|
||||
};
|
||||
|
||||
# Delete vendor directory to regenerate it consistently across platforms
|
||||
postPatch = ''
|
||||
# Delete vendor directory to regenerate it consistently across platforms
|
||||
rm -rf vendor
|
||||
# immich-kiosk bumps go at a faster cadence than nixpkgs
|
||||
sed 's/^go 1\.26\.\d+$/go 1.26/' go.mod
|
||||
'';
|
||||
vendorHash = "sha256-3M3fXwCkljfY8wjXf+PdcbqnkyPKaDCJWt9/nRA/+Dc=";
|
||||
vendorHash = "sha256-y6Xl00G+mkhRKVGwMS0WCXZhQqqGGX5qY8PhMxtw7z8=";
|
||||
proxyVendor = true;
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
;
|
||||
pnpm = pnpm_9;
|
||||
npmDeps = fetchNpmDeps {
|
||||
inherit src;
|
||||
sourceRoot = "${src.name}/frontend";
|
||||
hash = "sha256-8iKug4zsX3u0vS68osKRW6iOP+A3OdjI3yxNPIJaQqM=";
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-lNON0/lxix2aczC0+m7Er5Te1+4fsSoLkk6Z2pYzQYQ=";
|
||||
};
|
||||
|
||||
# Frontend is in a subdirectory
|
||||
pnpmRoot = "frontend";
|
||||
npmRoot = "frontend";
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpmConfigHook
|
||||
pnpm_9
|
||||
go-task
|
||||
npmHooks.npmConfigHook
|
||||
];
|
||||
|
||||
# Generate templ templates during vendor hash calculation
|
||||
# Don't run pnpm in this phase - filter out pnpmConfigHook
|
||||
# Don't run npm in this phase - filter out npmConfigHook
|
||||
overrideModAttrs = oldAttrs: {
|
||||
nativeBuildInputs = builtins.filter (drv: drv != pnpmConfigHook) (
|
||||
nativeBuildInputs = builtins.filter (drv: drv != npmHooks.npmConfigHook) (
|
||||
oldAttrs.nativeBuildInputs or [ ]
|
||||
);
|
||||
preBuild = ''
|
||||
go run github.com/a-h/templ/cmd/templ generate
|
||||
go tool templ generate
|
||||
'';
|
||||
};
|
||||
|
||||
# Generate templ templates and build frontend assets before Go build
|
||||
# Frontend assets are embedded into the binary via go:embed
|
||||
preBuild = ''
|
||||
go run github.com/a-h/templ/cmd/templ generate
|
||||
|
||||
pushd frontend
|
||||
pnpm build
|
||||
popd
|
||||
go tool templ generate
|
||||
task frontend
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue