From 583024221d3a8e5f0648c0e834328b2836d2aed0 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 14 Jun 2026 18:14:51 +0300 Subject: [PATCH] pizauth: fix systemd feature Although we had `systemd` included in `buildFeatures`, it didn't reach `$out/bin/pizauth`, because upstream's Makefile used `target/release/pizauth` as a Makefile target that `cargo build --release` (with or without `--features=systemd`) solves. --- pkgs/by-name/pi/pizauth/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) 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 = ''