1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 makeWrapper,
6 openresolv,
7 coreutils,
8 systemd,
9}:
10
11let
12 binPath = lib.makeBinPath [
13 coreutils
14 openresolv
15 systemd
16 ];
17
18in
19stdenv.mkDerivation {
20 pname = "update-resolv-conf";
21 version = "unstable-2017-06-21";
22
23 src = fetchFromGitHub {
24 owner = "masterkorp";
25 repo = "openvpn-update-resolv-conf";
26 rev = "43093c2f970bf84cd374e18ec05ac6d9cae444b8";
27 sha256 = "1lf66bsgv2w6nzg1iqf25zpjf4ckcr45adkpgdq9gvhkfnvlp8av";
28 };
29
30 nativeBuildInputs = [ makeWrapper ];
31
32 installPhase = ''
33 install -Dm555 update-resolv-conf.sh $out/libexec/openvpn/update-resolv-conf
34 install -Dm555 update-systemd-network.sh $out/libexec/openvpn/update-systemd-network
35
36 for i in $out/libexec/openvpn/*; do
37 wrapProgram $i --prefix PATH : ${binPath}
38 done
39 '';
40
41 meta = with lib; {
42 description = "Script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options";
43 homepage = "https://github.com/masterkorp/openvpn-update-resolv-conf/";
44 maintainers = with maintainers; [ abbradar ];
45 license = licenses.gpl2Only;
46 platforms = platforms.unix;
47 };
48}