From 44c1fb76321539ce0c3a3227d7adeceb69b95ef3 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 31 Aug 2023 18:30:22 +0100 Subject: [PATCH] delete now-unused (pkgs.liminix.network) interface address --- pkgs/liminix-tools/networking/default.nix | 26 +---------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/pkgs/liminix-tools/networking/default.nix b/pkgs/liminix-tools/networking/default.nix index bb39bcd..02c761a 100644 --- a/pkgs/liminix-tools/networking/default.nix +++ b/pkgs/liminix-tools/networking/default.nix @@ -18,32 +18,8 @@ let ''; in { - interface = { type ? "hardware", device, link ? null, primary ? null, id ? null, dependencies ? [] } @ args: - let name = "${device}.link"; - ups = - [] - ++ optional (type == "bridge") - "ip link add name ${device} type bridge" - ++ optional (type == "vlan") - "ip link add link ${link} name ${device} type vlan id ${id}" - ++ [(ifup name device)] - ++ optional (primary != null) - "ip link set dev ${device} master ${primary.device}"; - in oneshot { - inherit name; - up = lib.concatStringsSep "\n" ups; - down = "ip link set down dev ${device}"; - dependencies = dependencies ++ lib.optional (primary != null) primary; - }; inherit ifup; - address = interface: { family, dependencies ? [], prefixLength, address } @ args: - let inherit (builtins) toString; - in oneshot { - dependencies = [ interface ] ++ dependencies; - name = "${interface.name}.addr.${address}"; - up = "ip address add ${address}/${toString prefixLength} dev $(output ${interface} ifname)"; - down = "ip address del ${address}/${toString prefixLength} dev $(output ${interface} ifname)"; - }; + route = { name, target, via, dependencies, dev ? null }: let with_dev = if dev != null then "dev ${dev}" else ""; in oneshot {