fix: tv-deploy as real script so direnv exposes it in PATH
build / build (push) Failing after 3m59s

shellHook functions are invisible to direnv; writeShellScriptBin
produces an actual binary added to packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 20:17:03 +02:00
parent a8ff404116
commit d2ad1ebe0b
+10 -9
View File
@@ -43,6 +43,15 @@
sdkRoot = "${androidSdk}/libexec/android-sdk";
fonts = with pkgs; [ noto-fonts dejavu_fonts freefont_ttf ];
tvDeploy = pkgs.writeShellScriptBin "tv-deploy" ''
set -euo pipefail
trap 'adb disconnect "$TV_IP:5555"' EXIT
adb connect "$TV_IP:5555"
for apk in app/build/outputs/apk/*/release/*.apk; do
adb install -r "$apk"
done
'';
in
{
devShells.default = pkgs.mkShell {
@@ -52,6 +61,7 @@
pkgs.gradle_9
pkgs.imagemagick # banner/icon generation
pkgs.android-tools # adb for sideloading
tvDeploy
] ++ fonts;
ANDROID_HOME = sdkRoot;
@@ -64,15 +74,6 @@
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${sdkRoot}/build-tools/${buildToolsVersion}/aapt2";
FONTCONFIG_FILE = pkgs.makeFontsConf { fontDirectories = fonts; };
shellHook = ''
tv-deploy() (
trap 'adb disconnect "$TV_IP:5555"' EXIT
adb connect "$TV_IP:5555" || return 1
for apk in app/build/outputs/apk/*/release/*.apk; do
adb install -r "$apk" || return 1
done
)
'';
};
}
);