2025-02-10 21:55:08 +00:00
|
|
|
{ ifwait, liminix }:
|
2024-03-16 20:41:13 +00:00
|
|
|
{
|
2025-02-10 21:55:08 +00:00
|
|
|
state,
|
|
|
|
interface,
|
|
|
|
service,
|
2024-03-16 20:41:13 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (liminix.services) longrun;
|
2025-02-10 21:55:08 +00:00
|
|
|
in
|
|
|
|
longrun {
|
2024-03-16 20:41:13 +00:00
|
|
|
name = "ifwait.${interface.name}";
|
|
|
|
buildInputs = [ service ];
|
2024-06-16 11:58:06 +00:00
|
|
|
restart-on-upgrade = true;
|
2024-03-16 20:41:13 +00:00
|
|
|
run = ''
|
|
|
|
${ifwait}/bin/ifwait -s ${service.name} $(output ${interface} ifname) ${state}
|
|
|
|
'';
|
|
|
|
}
|