From c75583f32f06bdbe7e48b2065186f255bfb4b608 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Sun, 22 Mar 2026 20:04:14 +0100 Subject: [PATCH] cargo-bundle: restrict squashfsTools reference to Linux These are only needed to build appimages, which only exist on Linux. --- pkgs/by-name/ca/cargo-bundle/package.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ca/cargo-bundle/package.nix b/pkgs/by-name/ca/cargo-bundle/package.nix index 54eb345f941b..40ef02df4a62 100644 --- a/pkgs/by-name/ca/cargo-bundle/package.nix +++ b/pkgs/by-name/ca/cargo-bundle/package.nix @@ -8,7 +8,7 @@ wayland, openssl, squashfsTools, - makeWrapper, + makeBinaryWrapper, versionCheckHook, nix-update-script, }: @@ -28,7 +28,9 @@ rustPlatform.buildRustPackage (finalAttrs: { nativeBuildInputs = [ pkg-config - makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + makeBinaryWrapper ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ @@ -37,7 +39,8 @@ rustPlatform.buildRustPackage (finalAttrs: { openssl ]; - postFixup = '' + # squashfs tools are needed to build appimages for Linux + postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' wrapProgram $out/bin/cargo-bundle \ --prefix PATH : ${lib.makeBinPath [ squashfsTools ]} '';