about summary refs log tree commit diff
path: root/nixos/modules/services/networking/iwd.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-04-23 23:12:21 +0200
committerJörg Thalheim <joerg@thalheim.io>2017-05-21 11:05:35 +0100
commita527a47cd355c06ca9d1f1e13930f394e5148894 (patch)
treebe25e8e835e49676f1721781996d8c0a9e23b6c9 /nixos/modules/services/networking/iwd.nix
parentd81683d0a4619aea6a48bd985275bdc4c6bfd159 (diff)
iwd: init at unstable-2017-04-21
Diffstat (limited to 'nixos/modules/services/networking/iwd.nix')
-rw-r--r--nixos/modules/services/networking/iwd.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/iwd.nix b/nixos/modules/services/networking/iwd.nix
new file mode 100644
index 0000000000000..23787bce9911d
--- /dev/null
+++ b/nixos/modules/services/networking/iwd.nix
@@ -0,0 +1,34 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.networking.wireless.iwd;
+in {
+  options.networking.wireless.iwd.enable = mkEnableOption "iwd";
+
+  config = mkIf cfg.enable {
+    assertions = [{
+      assertion = !config.networking.wireless.enable;
+      message = ''
+        Only one wireless daemon is allowed at the time: networking.wireless.enable and networking.wireless.iwd.enable are mutually exclusive.
+      '';
+    }];
+
+    # for iwctl
+    environment.systemPackages =  [ pkgs.iwd ];
+
+    services.dbus.packages = [ pkgs.iwd ];
+
+    systemd.services.iwd = {
+      description = "Wireless daemon";
+      before = [ "network.target" ];
+      wants = [ "network.target" ];
+      wantedBy = [ "multi-user.target" ];
+
+      serviceConfig.ExecStart = "${pkgs.iwd}/bin/iwd";
+    };
+  };
+
+  meta.maintainers = with lib.maintainers; [ mic92 ];
+}