run on ios

This commit is contained in:
2026-10-07 13:00:58 +02:00
parent aa647ee869
commit 7fb87fbb96
3 changed files with 46 additions and 4 deletions
+23
View File
@@ -40,6 +40,23 @@
echo no | avdmanager create avd -n "Pixel_5_API34" -k "system-images;android-34;google_apis_playstore;${if pkgs.stdenv.hostPlatform.isAarch64 then "arm64-v8a" else "x86_64"}" -d "pixel_5"
fi
'';
# macOS only: run on the iOS simulator when Xcode with a simulator is installed.
scripts.run-ios = lib.mkIf pkgs.stdenv.isDarwin {
exec = ''
# devenv points DEVELOPER_DIR at the Nix SDK, which xcode-select would echo back.
dev_dir="$(/usr/bin/env -u DEVELOPER_DIR /usr/bin/xcode-select -p 2>/dev/null)"
[ -x "$dev_dir/usr/bin/simctl" ] || dev_dir=/Applications/Xcode.app/Contents/Developer
if ! DEVELOPER_DIR="$dev_dir" /usr/bin/xcrun simctl list devices available 2>/dev/null | grep -q iPhone; then
echo "No Xcode iOS simulator found, skipping iOS."
exit 0
fi
# devenv's Nix Apple SDK, xcrun and compiler wrappers break xcodebuild, so build in a clean env.
exec /usr/bin/env -i HOME="$HOME" USER="$USER" TERM="$TERM" LANG=en_US.UTF-8 \
DEVELOPER_DIR="$dev_dir" \
PATH="${lib.makeBinPath [ pkgs.bun pkgs.nodejs_24 pkgs.cocoapods ]}:/usr/bin:/bin:/usr/sbin:/sbin" \
bunx expo run:ios --no-bundler "$@"
'';
};
<@endif>
languages.go.enable = true;
languages.typescript.enable = true;
@@ -100,6 +117,12 @@
on = "always";
};
};
# Reuses the Metro bundler started by expodev.
expoios = lib.mkIf pkgs.stdenv.isDarwin {
exec = "run-ios";
cwd = "./apps/mobile";
after = ["devenv:processes:expodev@started"];
};
<@endif>
sqlwatcher = {
exec = "sqlc generate";