This commit is contained in:
2026-03-03 14:53:21 -05:00
parent 108b714fcb
commit 288a60cfa1
2 changed files with 15 additions and 13 deletions

View File

@@ -4,4 +4,5 @@ let
in in
{ {
pinepods = pkgs.callPackage ./pinepods.nix { }; pinepods = pkgs.callPackage ./pinepods.nix { };
pinepods-frontend = (pkgs.callPackage ./pinepods.nix { }).frontend;
} }

View File

@@ -3,6 +3,7 @@
, rustPlatform , rustPlatform
, pkg-config , pkg-config
, wrapGAppsHook3 , wrapGAppsHook3
, llvmPackages
, webkitgtk_4_1 , webkitgtk_4_1
, gtk3 , gtk3
, glib , glib
@@ -42,24 +43,29 @@ let
sourceRoot = "source/web"; sourceRoot = "source/web";
cargoRoot = "."; cargoRoot = ".";
postUnpack = ''
cp ${builtins.toString ./.}/Cargo.frontend.lock $sourceRoot/Cargo.lock
'';
cargoLock = { cargoLock = {
lockFile = "${builtins.toString ./.}/Cargo.frontend.lock"; lockFile = ./Cargo.frontend.lock;
outputHashes = { outputHashes = {
"i18nrs-0.1.7" = "sha256-LEHQ8GI3eVKwhtxetxyIY4HV16TS3D9n+2Hh+sm5j74="; "i18nrs-0.1.7" = "sha256-LEHQ8GI3eVKwhtxetxyIY4HV16TS3D9n+2Hh+sm5j74=";
}; };
}; };
nativeBuildInputs = [ trunk wasm-bindgen-cli ]; nativeBuildInputs = [ trunk wasm-bindgen-cli llvmPackages.lld ];
buildPhase = '' buildPhase = ''
cp -r . $NIX_BUILD_TOP/web-build cp -r . $NIX_BUILD_TOP/web-build
chmod -R u+w $NIX_BUILD_TOP/web-build chmod -R u+w $NIX_BUILD_TOP/web-build
cd $NIX_BUILD_TOP/web-build cd $NIX_BUILD_TOP/web-build
mkdir -p dist mkdir -p dist
export HOME=$NIX_BUILD_TOP
export XDG_CACHE_HOME=$NIX_BUILD_TOP/cache
mkdir -p $NIX_BUILD_TOP/cache
# Use nixpkgs wasm-bindgen, skip trunk's version check
export WASM_BINDGEN=$(which wasm-bindgen)
export TRUNK_SKIP_VERSION_CHECK=true
RUSTFLAGS="--cfg=web_sys_unstable_apis" trunk build --release RUSTFLAGS="--cfg=web_sys_unstable_apis" trunk build --release
''; '';
@@ -78,12 +84,8 @@ rustPlatform.buildRustPackage {
sourceRoot = "source/web/src-tauri"; sourceRoot = "source/web/src-tauri";
cargoRoot = "."; cargoRoot = ".";
postUnpack = ''
cp ${builtins.toString ./.}/Cargo.lock $sourceRoot/Cargo.lock
'';
cargoLock = { cargoLock = {
lockFile = "${builtins.toString ./.}/Cargo.lock"; lockFile = ./Cargo.lock;
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@@ -114,7 +116,6 @@ rustPlatform.buildRustPackage {
TAURI_SKIP_DEVSERVER_CHECK = "true"; TAURI_SKIP_DEVSERVER_CHECK = "true";
preBuild = '' preBuild = ''
# Link the pre-built frontend dist where tauri.conf.json expects it (../ from src-tauri)
ln -s ${frontend} $NIX_BUILD_TOP/source/web/dist ln -s ${frontend} $NIX_BUILD_TOP/source/web/dist
''; '';