about summary refs log tree commit diff
path: root/nixos/modules/services/networking/connman.nix
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2015-09-12 21:28:53 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2015-09-12 23:31:50 +0900
commit095bf185ecd9fe7c9e889284763be45b4c7e18b6 (patch)
tree18d9ac12c2c7b1340441ee1fee96780a47770c76 /nixos/modules/services/networking/connman.nix
parent54e430a68959bd090dd31513b91de1f71eb5f0da (diff)
downloadnixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.tar
nixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.tar.gz
nixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.tar.bz2
nixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.tar.lz
nixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.tar.xz
nixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.tar.zst
nixlib-095bf185ecd9fe7c9e889284763be45b4c7e18b6.zip
connman: improved configuration support
Diffstat (limited to 'nixos/modules/services/networking/connman.nix')
-rw-r--r--nixos/modules/services/networking/connman.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/connman.nix b/nixos/modules/services/networking/connman.nix
index 482b61997ae1..deb1cbfc1858 100644
--- a/nixos/modules/services/networking/connman.nix
+++ b/nixos/modules/services/networking/connman.nix
@@ -5,7 +5,12 @@ with lib;
 
 let
   cfg = config.networking.connman;
+  configFile = pkgs.writeText "connman.conf" ''
+    [General]
+    NetworkInterfaceBlacklist=${concatStringsSep "," cfg.networkInterfaceBlacklist}
 
+    ${cfg.extraConfig}
+  '';
 in {
 
   ###### interface
@@ -22,6 +27,23 @@ in {
         '';
       };
 
+      extraConfig = mkOption {
+        type = types.lines;
+        default = ''
+        '';
+        description = ''
+          Configuration lines appended to the generated connman configuration file.
+        '';
+      };
+
+      networkInterfaceBlacklist = mkOption {
+        type = with types; listOf string;
+        default = [ "vmnet" "vboxnet" "virbr" "ifb" "ve" ];
+        description = ''
+          Default blacklisted interfaces, this includes NixOS containers interfaces (ve).
+        '';
+      };
+
     };
 
   };
@@ -51,7 +73,7 @@ in {
         Type = "dbus";
         BusName = "net.connman";
         Restart = "on-failure";
-        ExecStart = "${pkgs.connman}/sbin/connmand --nodaemon";
+        ExecStart = "${pkgs.connman}/sbin/connmand --config=${configFile} --nodaemon";
         StandardOutput = "null";
       };
     };