1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.networking.wireless.iwd;
7in {
8 options.networking.wireless.iwd.enable = mkEnableOption "iwd";
9
10 config = mkIf cfg.enable {
11 assertions = [{
12 assertion = !config.networking.wireless.enable;
13 message = ''
14 Only one wireless daemon is allowed at the time: networking.wireless.enable and networking.wireless.iwd.enable are mutually exclusive.
15 '';
16 }];
17
18 # for iwctl
19 environment.systemPackages = [ pkgs.iwd ];
20
21 services.dbus.packages = [ pkgs.iwd ];
22
23 systemd.services.iwd = {
24 description = "Wireless daemon";
25 before = [ "network.target" ];
26 wants = [ "network.target" ];
27 wantedBy = [ "multi-user.target" ];
28
29 serviceConfig.ExecStart = "${pkgs.iwd}/bin/iwd";
30 };
31 };
32
33 meta.maintainers = with lib.maintainers; [ mic92 ];
34}