feat(modules/hostapd): offer readiness oneshot
Some checks failed
build liminix / build_vm_qemu_mips (pull_request) Failing after 27s
Some checks failed
build liminix / build_vm_qemu_mips (pull_request) Failing after 27s
WLAN oper wait until the WLAN interface is ready. Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
5590fea16e
commit
13069415fd
2 changed files with 27 additions and 0 deletions
|
@ -20,6 +20,10 @@ in {
|
||||||
system.service.hostapd = mkOption {
|
system.service.hostapd = mkOption {
|
||||||
type = liminix.lib.types.serviceDefn;
|
type = liminix.lib.types.serviceDefn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.service.hostapd-ready = mkOption {
|
||||||
|
type = liminix.lib.types.serviceDefn;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
system.service.hostapd = liminix.callService ./service.nix {
|
system.service.hostapd = liminix.callService ./service.nix {
|
||||||
|
@ -34,5 +38,12 @@ in {
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.service.hostapd-ready = liminix.callService ./ready.nix {
|
||||||
|
interface = mkOption {
|
||||||
|
type = liminix.lib.types.interface;
|
||||||
|
description = "Interface for which to wait that the oper state Master or Master (VLAN) has been reached.";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
16
modules/hostapd/ready.nix
Normal file
16
modules/hostapd/ready.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
liminix
|
||||||
|
, ifwait
|
||||||
|
, lib
|
||||||
|
}:
|
||||||
|
{ interface } :
|
||||||
|
let
|
||||||
|
inherit (liminix.services) oneshot;
|
||||||
|
in oneshot {
|
||||||
|
name = "${interface.name}.wlan-oper";
|
||||||
|
up = ''
|
||||||
|
${ifwait}/bin/ifbridgeable -v $(output ${interface} ifname)
|
||||||
|
'';
|
||||||
|
|
||||||
|
dependencies = [ interface ];
|
||||||
|
}
|
Loading…
Reference in a new issue