nixos/hostapd: escape interface names for hostapd
Same problem as described in acbadcdbba
.
When using multiple interfaces for wifi with `networking.wlanInterfaces`
and the interface for `hostapd` contains a dash, this will fail as
systemd escapes dashes in its device names.
This commit is contained in:
parent
6b2bd330fa
commit
f975bbae11
@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
|
||||
# TODO:
|
||||
#
|
||||
@ -12,6 +12,8 @@ let
|
||||
|
||||
cfg = config.services.hostapd;
|
||||
|
||||
escapedInterface = utils.escapeSystemdPath cfg.interface;
|
||||
|
||||
configFile = pkgs.writeText "hostapd.conf" ''
|
||||
interface=${cfg.interface}
|
||||
driver=${cfg.driver}
|
||||
@ -157,8 +159,8 @@ in
|
||||
{ description = "hostapd wireless AP";
|
||||
|
||||
path = [ pkgs.hostapd ];
|
||||
after = [ "sys-subsystem-net-devices-${cfg.interface}.device" ];
|
||||
bindsTo = [ "sys-subsystem-net-devices-${cfg.interface}.device" ];
|
||||
after = [ "sys-subsystem-net-devices-${escapedInterface}.device" ];
|
||||
bindsTo = [ "sys-subsystem-net-devices-${escapedInterface}.device" ];
|
||||
requiredBy = [ "network-link-${cfg.interface}.service" ];
|
||||
|
||||
serviceConfig =
|
||||
|
Loading…
Reference in New Issue
Block a user