From 32eb7980e105d4ed38f2a401787862e0920de2a7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 26 Dec 2024 22:04:28 +0100 Subject: [PATCH] ppp: add withSystemd option Not all platforms support systemd. This fixes e.g. pkgsStatic.ppp. Fixes: 899053142435 ("ppp: add systemd sd-notify support") --- pkgs/by-name/pp/ppp/package.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/pp/ppp/package.nix b/pkgs/by-name/pp/ppp/package.nix index 2316092ccfbc..562bc812dfd7 100644 --- a/pkgs/by-name/pp/ppp/package.nix +++ b/pkgs/by-name/pp/ppp/package.nix @@ -10,6 +10,7 @@ openssl, pkg-config, stdenv, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, systemdMinimal, }: @@ -28,7 +29,7 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--sysconfdir=/etc" "--with-openssl=${openssl.dev}" - "--enable-systemd" + (lib.enableFeature withSystemd "systemd") ]; nativeBuildInputs = [ @@ -36,14 +37,17 @@ stdenv.mkDerivation rec { autoreconfHook ]; - buildInputs = [ - bash - libpcap - libxcrypt - linux-pam - openssl - systemdMinimal - ]; + buildInputs = + [ + bash + libpcap + libxcrypt + linux-pam + openssl + ] + ++ lib.optionals withSystemd [ + systemdMinimal + ]; postPatch = '' for file in $(find -name Makefile.linux); do