From 6eb837c54d707affba369d69e002fb6a5d9b6368 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 14 Jun 2026 18:03:57 +0300 Subject: [PATCH 1/2] pizauth: use a global enableSystemd package flag Makes overlays easier for systems such as [sixos][1] or [finix][2]. [1]: https://codeberg.org/amjoseph/sixos [2]: https://github.com/finix-community/finix --- pkgs/by-name/pi/pizauth/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/pi/pizauth/package.nix b/pkgs/by-name/pi/pizauth/package.nix index 1d0a5f9bb3cf..065dc042987a 100644 --- a/pkgs/by-name/pi/pizauth/package.nix +++ b/pkgs/by-name/pi/pizauth/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, stdenv, nix-update-script, + enableSystemd ? stdenv.hostPlatform.isLinux, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -19,7 +20,7 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-pxzPcieUXE3VOyGNDaeDHUQPayRDZXpW57VWMejlZ4k="; - buildFeatures = lib.optionals stdenv.hostPlatform.isLinux [ + buildFeatures = lib.optionals enableSystemd [ "systemd" ]; @@ -29,7 +30,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; postInstall = '' - make PREFIX=$out install ${lib.optionalString stdenv.hostPlatform.isLinux "install-systemd"} + make PREFIX=$out install ${lib.optionalString enableSystemd "install-systemd"} ''; passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=pizauth-(.*)" ]; }; From 583024221d3a8e5f0648c0e834328b2836d2aed0 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 14 Jun 2026 18:14:51 +0300 Subject: [PATCH 2/2] 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 = ''