remove interface.device
build-time uses can mostly be replaced with interface.name for runtime uses, switch to $(output ${interface} name)
This commit is contained in:
parent
6da0e67621
commit
540a1dfd76
6 changed files with 22 additions and 22 deletions
|
@ -13,14 +13,15 @@ let
|
|||
type = "bridge";
|
||||
};
|
||||
addif = member :
|
||||
oneshot {
|
||||
name = "add-${member.device}-to-br-${primary.device}";
|
||||
up = "${ifwait}/bin/ifwait ${member.device} running && ip link set dev ${member.device} master ${primary.device}";
|
||||
down = "ip link set dev ${member.device} nomaster";
|
||||
let ifname = "$(output ${member} ifname)";
|
||||
in oneshot {
|
||||
name = "add-${member.name}-to-br-${primary.name}";
|
||||
up = "${ifwait}/bin/ifwait ${ifname} running && ip link set dev ${ifname} master $(output ${primary} ifname)";
|
||||
down = "ip link set dev ${ifname} nomaster";
|
||||
dependencies = [ primary member ];
|
||||
};
|
||||
|
||||
in (bundle {
|
||||
name = "bridge-${primary.device}-members";
|
||||
in bundle {
|
||||
name = "bridge-${primary.name}-members";
|
||||
contents = [ primary ] ++ map addif members;
|
||||
}) // { device = primary.device; }
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
, resolvconf
|
||||
}:
|
||||
let
|
||||
name = "${interface.device}.dnsmasq";
|
||||
name = "${interface.name}.dnsmasq";
|
||||
inherit (liminix.services) longrun;
|
||||
inherit (lib) concatStringsSep;
|
||||
in
|
||||
|
@ -27,7 +27,7 @@ longrun {
|
|||
--user=${user} \
|
||||
--domain=${domain} \
|
||||
--group=${group} \
|
||||
--interface=${interface.device} \
|
||||
--interface=$(output ${interface} ifname) \
|
||||
${lib.concatStringsSep " " (builtins.map (r: "--dhcp-range=${r}") ranges)} \
|
||||
${lib.concatStringsSep " " (builtins.map (r: "--server=${r}") upstreams)} \
|
||||
--keep-in-foreground \
|
||||
|
|
|
@ -17,7 +17,7 @@ let
|
|||
# we'll add them as top-level attributes and rename params to
|
||||
# extraParams
|
||||
|
||||
name = "${interface.device}.hostapd";
|
||||
name = "${interface.name}.hostapd";
|
||||
defaults = {
|
||||
driver = "nl80211";
|
||||
logger_syslog = "-1";
|
||||
|
@ -35,5 +35,5 @@ let
|
|||
in longrun {
|
||||
inherit name;
|
||||
dependencies = [ interface ];
|
||||
run = "${hostapd}/bin/hostapd -i ${interface.device} -P /run/${name}.pid -S ${conf}";
|
||||
run = "${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}.pid -S ${conf}";
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{ interface, ppp-options }:
|
||||
let
|
||||
inherit (liminix.services) longrun;
|
||||
name = "${interface.device}.pppoe";
|
||||
name = "${interface.name}.pppoe";
|
||||
ip-up = writeAshScript "ip-up" {} ''
|
||||
. ${serviceFns}
|
||||
(in_outputs ${name}
|
||||
|
@ -42,7 +42,10 @@ let
|
|||
in
|
||||
longrun {
|
||||
inherit name;
|
||||
run = "${ppp}/bin/pppd pty '${pppoe}/bin/pppoe -I ${interface.device}' ${lib.concatStringsSep " " ppp-options'}" ;
|
||||
run = ''
|
||||
. ${serviceFns}
|
||||
${ppp}/bin/pppd pty "${pppoe}/bin/pppoe -I $(output ${interface} ifname)" ${lib.concatStringsSep " " ppp-options'}
|
||||
'';
|
||||
notification-fd = 10;
|
||||
dependencies = [ interface ];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue