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.packages = [ pkgs.iwd ];
24
25 systemd.network.links."80-iwd" = {
26 matchConfig.Type = "wlan";
27 linkConfig.NamePolicy = "keep kernel";
28 };
29
30 systemd.services.iwd.wantedBy = [ "multi-user.target" ];
31 };
32
33 meta.maintainers = with lib.maintainers; [ mic92 dtzWill ];
34}