2022-04-08 04:36:20 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, iproute2
|
|
|
|
, runtimeShell
|
|
|
|
, systemd
|
|
|
|
, coreutils
|
|
|
|
, util-linux
|
|
|
|
}:
|
2019-10-01 13:40:43 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "update-systemd-resolved";
|
2022-04-08 04:36:20 +01:00
|
|
|
# when updating this, check if additional binaries need injecting into PATH
|
2019-10-01 13:40:43 +01:00
|
|
|
version = "1.3.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jonathanio";
|
|
|
|
repo = "update-systemd-resolved";
|
|
|
|
rev = "v${version}";
|
2022-04-08 04:36:20 +01:00
|
|
|
hash = "sha256-lYJTR3oBmpENcqNHa9PFXsw7ly6agwjBWf4UXf1d8Kc=";
|
2019-10-01 13:40:43 +01:00
|
|
|
};
|
|
|
|
|
2022-04-08 04:36:20 +01:00
|
|
|
# set SCRIPT_NAME in case we are wrapped and inject PATH
|
|
|
|
patches = [
|
|
|
|
./update-systemd-resolved.patch
|
2019-10-01 13:40:43 +01:00
|
|
|
];
|
|
|
|
|
2022-04-08 04:36:20 +01:00
|
|
|
PREFIX = "${placeholder "out"}/libexec/openvpn";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace ${PREFIX}/update-systemd-resolved \
|
|
|
|
--subst-var-by PATH ${lib.makeBinPath [ coreutils iproute2 runtimeShell systemd util-linux ]}
|
2019-10-01 13:40:43 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-10-01 13:40:43 +01:00
|
|
|
description = "Helper script for OpenVPN to directly update the DNS settings of a link through systemd-resolved via DBus";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/jonathanio/update-systemd-resolved";
|
2022-04-08 04:36:20 +01:00
|
|
|
license = licenses.gpl3Only;
|
2019-10-01 13:40:43 +01:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
2022-04-08 04:36:20 +01:00
|
|
|
platforms = platforms.linux;
|
2019-10-01 13:40:43 +01:00
|
|
|
};
|
|
|
|
}
|