about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2014-10-27 20:36:53 +0300
committerCray Elliott <MP2E@archlinux.us>2014-10-28 03:04:14 -0700
commit1f101efa88037039161d91b3c8781c4a4b2d697b (patch)
tree0ac2145b4c39a42e05b2c6085737855c056e6cd8 /pkgs
parent72d7324af5d5b119a30f66a1c93d5de41a529967 (diff)
downloadnixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.tar
nixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.tar.gz
nixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.tar.bz2
nixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.tar.lz
nixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.tar.xz
nixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.tar.zst
nixlib-1f101efa88037039161d91b3c8781c4a4b2d697b.zip
update-resolv-conf: add package
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/openvpn/update-resolv-conf.nix29
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/tools/networking/openvpn/update-resolv-conf.nix b/pkgs/tools/networking/openvpn/update-resolv-conf.nix
new file mode 100644
index 000000000000..37d38555e618
--- /dev/null
+++ b/pkgs/tools/networking/openvpn/update-resolv-conf.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchgit, makeWrapper, openresolv, coreutils }:
+
+stdenv.mkDerivation rec {
+  name = "update-resolv-conf";
+
+  src = fetchgit {
+    url = https://github.com/masterkorp/openvpn-update-resolv-conf/;
+    rev = "dd968419373bce71b22bbd26de962e89eb470670";
+    sha256 = "dd0e3ea3661253d565bda876eb52a3f8461a3fc8237a81c40809c2071f83add1";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    install -Dm555 update-resolv-conf.sh $out/libexec/openvpn/update-resolv-conf
+    sed -i 's,^\(RESOLVCONF=\).*,\1resolvconf,' $out/libexec/openvpn/update-resolv-conf
+
+    wrapProgram $out/libexec/openvpn/update-resolv-conf \
+        --prefix PATH : ${coreutils}/bin:${openresolv}/sbin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options";
+    homepage = https://github.com/masterkorp/openvpn-update-resolv-conf/;
+    maintainer = maintainers.abbradar;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7eb0351a8907..ae7c0965b094 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1923,6 +1923,8 @@ let
 
   openvpn_learnaddress = callPackage ../tools/networking/openvpn/openvpn_learnaddress.nix { };
 
+  update-resolv-conf = callPackage ../tools/networking/openvpn/update-resolv-conf.nix { };
+
   openvswitch = callPackage ../os-specific/linux/openvswitch { };
 
   optipng = callPackage ../tools/graphics/optipng {