mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
vpnc-scripts: only reference systemd when available
This fixes e.g. static builds, where systemd is unsupported.
This commit is contained in:
parent
06892faa1a
commit
5ca7d9a48b
1 changed files with 5 additions and 1 deletions
|
@ -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"
|
||||
''
|
||||
+ ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue