implement ifwait trigger service and use in bridge

should we convert all ifwait uses to this trigger too? seems
reasonable
This commit is contained in:
Daniel Barlow 2024-03-16 20:41:13 +00:00
parent fad0a47b75
commit 28a5dec7dd
5 changed files with 91 additions and 14 deletions

15
modules/ifwait/ifwait.nix Normal file
View file

@ -0,0 +1,15 @@
{ ifwait, liminix } :
{
state
, interface
, service
}:
let
inherit (liminix.services) longrun;
in longrun {
name = "ifwait.${interface.name}";
buildInputs = [ service ];
run = ''
${ifwait}/bin/ifwait -s ${service.name} $(output ${interface} ifname) ${state}
'';
}