diff --git a/pkgs/by-name/pi/pizauth/package.nix b/pkgs/by-name/pi/pizauth/package.nix index 065dc042987a..a23a84d38ffb 100644 --- a/pkgs/by-name/pi/pizauth/package.nix +++ b/pkgs/by-name/pi/pizauth/package.nix @@ -27,6 +27,14 @@ rustPlatform.buildRustPackage (finalAttrs: { preConfigure = '' substituteInPlace lib/systemd/user/pizauth.service \ --replace-fail /usr/bin/ ''${!outputBin}/bin/ + # Upstream's Makefile uses target/release/pizauth as a Makefile target that + # the `install` target depends upon. Nixpkgs' cargoBuildHook defaults to + # using the explicit `--target @rustcTargetSpec@` flag, so that the + # executable always ends up in + # `target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release`. To make the + # Makefile not run cargo build again, we use this substitution. + substituteInPlace Makefile \ + --replace-fail target/release target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release ''; postInstall = ''