From 6da0e67621a3e297fdeeffda2fc67ae3bd235daf Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 27 Aug 2023 22:34:00 +0100 Subject: [PATCH] create outputs for network interface --- pkgs/liminix-tools/networking/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/liminix-tools/networking/default.nix b/pkgs/liminix-tools/networking/default.nix index cadb1fc..d5cf68d 100644 --- a/pkgs/liminix-tools/networking/default.nix +++ b/pkgs/liminix-tools/networking/default.nix @@ -9,7 +9,8 @@ let inherit (lib) concatStringsSep optional; in { interface = { type ? "hardware", device, link ? null, primary ? null, id ? null, dependencies ? [] } @ args: - let ups = + let name = "${device}.link"; + ups = [] ++ optional (type == "bridge") "ip link add name ${device} type bridge" @@ -20,7 +21,7 @@ in { ++ optional (primary != null) "ip link set dev ${device} master ${primary.device}"; in oneshot { - name = "${device}.link"; + inherit name; up = lib.concatStringsSep "\n" ups; down = "ip link set down dev ${device}"; dependencies = dependencies ++ lib.optional (primary != null) primary;