From 5ca7d9a48bbd2dc4ab90108999d3e23b42e38f7c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Jun 2025 14:44:10 +0200 Subject: [PATCH] vpnc-scripts: only reference systemd when available This fixes e.g. static builds, where systemd is unsupported. --- pkgs/by-name/vp/vpnc-scripts/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/vp/vpnc-scripts/package.nix b/pkgs/by-name/vp/vpnc-scripts/package.nix index 4ff2b6d355e2..9be974347412 100644 --- a/pkgs/by-name/vp/vpnc-scripts/package.nix +++ b/pkgs/by-name/vp/vpnc-scripts/package.nix @@ -10,6 +10,7 @@ nettools, openresolv, systemd, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, }: stdenv.mkDerivation { @@ -36,7 +37,10 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isLinux '' substituteInPlace $out/bin/vpnc-script \ - --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" \ + --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" + '' + + lib.optionalString withSystemd '' + substituteInPlace $out/bin/vpnc-script \ --replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl" '' + ''