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
{
pinepods = pkgs.callPackage ./pinepods.nix { };
pinepods-frontend = (pkgs.callPackage ./pinepods.nix { }).frontend;
}

View File

@@ -3,6 +3,7 @@
, rustPlatform
, pkg-config
, wrapGAppsHook3
, llvmPackages
, webkitgtk_4_1
, gtk3
, glib
@@ -42,24 +43,29 @@ let
sourceRoot = "source/web";
cargoRoot = ".";
postUnpack = ''
cp ${builtins.toString ./.}/Cargo.frontend.lock $sourceRoot/Cargo.lock
'';
cargoLock = {
lockFile = "${builtins.toString ./.}/Cargo.frontend.lock";
lockFile = ./Cargo.frontend.lock;
outputHashes = {
"i18nrs-0.1.7" = "sha256-LEHQ8GI3eVKwhtxetxyIY4HV16TS3D9n+2Hh+sm5j74=";
};
};
nativeBuildInputs = [ trunk wasm-bindgen-cli ];
nativeBuildInputs = [ trunk wasm-bindgen-cli llvmPackages.lld ];
buildPhase = ''
cp -r . $NIX_BUILD_TOP/web-build
chmod -R u+w $NIX_BUILD_TOP/web-build
cd $NIX_BUILD_TOP/web-build
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
'';
@@ -78,12 +84,8 @@ rustPlatform.buildRustPackage {
sourceRoot = "source/web/src-tauri";
cargoRoot = ".";
postUnpack = ''
cp ${builtins.toString ./.}/Cargo.lock $sourceRoot/Cargo.lock
'';
cargoLock = {
lockFile = "${builtins.toString ./.}/Cargo.lock";
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [
@@ -114,7 +116,6 @@ rustPlatform.buildRustPackage {
TAURI_SKIP_DEVSERVER_CHECK = "true";
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
'';