liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6da0e67621a3e297fdeeffda2fc67ae3bd235daf
parent 485ecc03b0c11a9e865ec8d37604f7dff15313a9
Author: Daniel Barlow <dan@telent.net>
Date:   Sun, 27 Aug 2023 22:34:00 +0100

create outputs for network interface

Diffstat:
Mpkgs/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 @@ -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;