From 01933d17ca761caaabfe0320ab95fcfd5bf45b45 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 18 Jan 2022 21:11:00 +0100 Subject: [PATCH] pkgs/switches/shared: fix for nullable vlan --- nix/pkgs/switches/shared.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/pkgs/switches/shared.nix b/nix/pkgs/switches/shared.nix index 40a3586..e548cf1 100644 --- a/nix/pkgs/switches/shared.nix +++ b/nix/pkgs/switches/shared.nix @@ -17,6 +17,13 @@ rec { else ra < rb ); sortNetsByVlan = builtins.sort (net1: net2: - config.site.net.${net1}.vlan < config.site.net.${net2}.vlan + let + vlan1 = config.site.net.${net1}.vlan; + vlan2 = config.site.net.${net2}.vlan; + in if vlan1 == null + then true + else if vlan2 == null + then false + else vlan1 < vlan2 ); }