WIP push to see what passes

This commit is contained in:
Daniel Barlow 2023-03-01 22:24:58 +00:00
parent 259f5c767b
commit adc198b3af
7 changed files with 100 additions and 57 deletions

View file

@ -8,7 +8,7 @@ let
inherit (liminix.services) oneshot longrun;
inherit (lib) concatStringsSep optional;
in {
interface = { type, device, primary ? null, dependencies ? [] } @ args:
interface = { type ? "hardware", device, primary ? null, dependencies ? [] } @ args:
let ups =
[]
++ optional (type == "bridge")
@ -25,10 +25,10 @@ in {
} // {
inherit device;
};
address = interface: { family, prefixLength, address } @ args:
address = interface: { family, dependencies ? [], prefixLength, address } @ args:
let inherit (builtins) toString;
in oneshot {
dependencies = [ interface ];
dependencies = [ interface ] ++ dependencies;
name = "${interface.device}.addr.${address}";
up = "ip address add ${address}/${toString prefixLength} dev ${interface.device} ";
down = "ip address del ${address}/${toString prefixLength} dev ${interface.device} ";