nixos/wpa_supplicant: escape interface names to listen on
Systemd provides some functionality to escape strings that are supposed to be part of a unit name[1]. This seems to be used for interface names in `sys-subsystem-net-devices-{interface}.device` and breaks wpa_supplicant if the wireless interface name has a dash which is encoded to \x2d. Such an interface name is rather rare, but used i.e. when configuring multiple wireless interfaces with `networking.wlanInterfaces`[2] to have on interface for `wpa_supplicant` and another one for `hostapd`. [1] https://www.freedesktop.org/software/systemd/man/systemd-escape.html [2] https://nixos.org/nixos/options.html#networking.wlaninterfaces
This commit is contained in:
parent
eb965a4b38
commit
acbadcdbba
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -193,7 +193,7 @@ in {
|
|||
# FIXME: start a separate wpa_supplicant instance per interface.
|
||||
systemd.services.wpa_supplicant = let
|
||||
ifaces = cfg.interfaces;
|
||||
deviceUnit = interface: [ "sys-subsystem-net-devices-${interface}.device" ];
|
||||
deviceUnit = interface: [ "sys-subsystem-net-devices-${utils.escapeSystemdPath interface}.device" ];
|
||||
in {
|
||||
description = "WPA Supplicant";
|
||||
|
||||
|
|
Loading…
Reference in a new issue