nixpkgs/pkgs/tools/networking/vpnc-scripts/default.nix
Matt McHenry 12368c04d1 vpnc-scripts: 2020-02-21 -> 2021-03-21
adds resolvectl support; as suggested by @liff
2021-06-02 19:22:13 -04:00

41 lines
1.3 KiB
Nix

{ lib, stdenv, fetchgit
, makeWrapper
, nettools, gawk, systemd, openresolv, coreutils, gnugrep
}:
stdenv.mkDerivation {
pname = "vpnc-scripts";
version = "unstable-2021-03-21";
src = fetchgit {
url = "git://git.infradead.org/users/dwmw2/vpnc-scripts.git";
rev = "8fff06090ed193c4a7285e9a10b42e6679e8ecf3";
sha256 = "14bzzpwz7kdmlbx825h6s4jjdml9q6ziyrq8311lp8caql68qdq1";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp vpnc-script $out/bin
'';
preFixup = ''
substituteInPlace $out/bin/vpnc-script \
--replace "which" "type -P"
'' + lib.optionalString stdenv.isLinux ''
substituteInPlace $out/bin/vpnc-script \
--replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" \
--replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl"
'' + ''
wrapProgram $out/bin/vpnc-script \
--prefix PATH : "${lib.makeBinPath ([ nettools gawk coreutils gnugrep ] ++ lib.optionals stdenv.isLinux [ openresolv ])}"
'';
meta = with lib; {
description = "script for vpnc to configure the network routing and name service";
homepage = "https://www.infradead.org/openconnect/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ jerith666 ];
platforms = platforms.linux ++ platforms.darwin;
};
}