summary refs log tree commit diff
path: root/pkgs/tools/networking/network-manager/iodine
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/network-manager/iodine')
-rw-r--r--pkgs/tools/networking/network-manager/iodine/default.nix47
-rw-r--r--pkgs/tools/networking/network-manager/iodine/fix-paths.patch11
2 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/tools/networking/network-manager/iodine/default.nix b/pkgs/tools/networking/network-manager/iodine/default.nix
new file mode 100644
index 000000000000..a3dbeaf82651
--- /dev/null
+++ b/pkgs/tools/networking/network-manager/iodine/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, substituteAll, iodine, intltool, pkgconfig, networkmanager, libsecret
+, withGnome ? true, gnome3 }:
+
+let
+  pname = "NetworkManager-iodine";
+  version = "1.2.0";
+in stdenv.mkDerivation rec {
+  name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0njdigakidji6mfmbsp8lfi8wl88z1dk8cljbva2w0xazyddbwyh";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit iodine;
+    })
+  ];
+
+  buildInputs = [ iodine networkmanager ]
+    ++ stdenv.lib.optionals withGnome [ gnome3.gtk libsecret gnome3.networkmanagerapplet ];
+
+  nativeBuildInputs = [ intltool pkgconfig ];
+
+  # Fixes deprecation errors with networkmanager 1.10.2
+  NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
+
+  configureFlags = [
+    "--with-gnome=${if withGnome then "yes" else "no"}"
+    "--localstatedir=/" # needed for the management socket under /run/NetworkManager
+  ];
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      attrPath = "networkmanager-iodine";
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "NetworkManager's iodine plugin";
+    inherit (networkmanager.meta) maintainers platforms;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/tools/networking/network-manager/iodine/fix-paths.patch b/pkgs/tools/networking/network-manager/iodine/fix-paths.patch
new file mode 100644
index 000000000000..d32dbfadbafa
--- /dev/null
+++ b/pkgs/tools/networking/network-manager/iodine/fix-paths.patch
@@ -0,0 +1,11 @@
+--- a/src/nm-iodine-service.c
++++ b/src/nm-iodine-service.c
+@@ -62,7 +62,7 @@
+ 
+ static const char *iodine_binary_paths[] =
+ {
+-	"/usr/bin/iodine",
++	"@iodine@/bin/iodine",
+ 	"/usr/sbin/iodine",
+ 	"/usr/local/bin/iodine",
+ 	"/usr/local/sbin/iodine",