about summary refs log tree commit diff
path: root/pkgs/development/embedded
diff options
context:
space:
mode:
authorStefan Frijters <sfrijters@gmail.com>2024-03-11 12:14:52 +0100
committerStefan Frijters <sfrijters@gmail.com>2024-03-11 12:14:52 +0100
commit663096a9dc3efce72c84f0c6628dbcea981794ef (patch)
tree1f2c8db07b52caf7e389ab9262a8f5c61a4e9b46 /pkgs/development/embedded
parent028a4bdd6d3a13d0dc61de32868130d953dab366 (diff)
arduino-cli: only generate/install shell completion if we can run the executable
Diffstat (limited to 'pkgs/development/embedded')
-rw-r--r--pkgs/development/embedded/arduino/arduino-cli/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/embedded/arduino/arduino-cli/default.nix b/pkgs/development/embedded/arduino/arduino-cli/default.nix
index 95297f04424c6..630f72237676e 100644
--- a/pkgs/development/embedded/arduino/arduino-cli/default.nix
+++ b/pkgs/development/embedded/arduino/arduino-cli/default.nix
@@ -53,7 +53,7 @@ let
       "-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown"
     ] ++ lib.optionals stdenv.isLinux [ "-extldflags '-static'" ];
 
-    postInstall = ''
+    postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
       export HOME="$(mktemp -d)"
       for s in {bash,zsh,fish}; do
         $out/bin/arduino-cli completion $s > completion.$s
@@ -85,6 +85,7 @@ if stdenv.isLinux then
 
     extraInstallCommands = ''
       mv $out/bin/$name $out/bin/arduino-cli
+    '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
       cp -r ${pkg.outPath}/share $out/share
     '';
     passthru.pureGoPkg = pkg;