From dce3ffd58056ac61c6a06215b44135fcf909379e Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 23 Oct 2022 23:03:20 +0200 Subject: [PATCH] pkgs/switch-report: fix vlan ordering --- nix/pkgs/switch-report.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nix/pkgs/switch-report.nix b/nix/pkgs/switch-report.nix index 61e577e..6cd0604 100644 --- a/nix/pkgs/switch-report.nix +++ b/nix/pkgs/switch-report.nix @@ -49,7 +49,19 @@ let map (net: "${net} (`${toString config.site.net.${net}.vlan}`)" ) (builtins.sort (a: b: - config.site.net.${a}.vlan < config.site.net.${b}.vlan + let + vlanA = config.site.net.${a}.vlan; + vlanB = config.site.net.${b}.vlan; + in + ( + if vlanA == null + then 4096 + else vlanA + ) < ( + if vlanB == null + then 4096 + else vlanB + ) ) link.nets) ) }|