From cbd5ca59ee18e08cf27e80a1747816eeca243c05 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 24 Apr 2022 00:23:48 +0200 Subject: [PATCH] Disable polybar modules per machine by setting them to null --- profiles/xsession/polybar.nix | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/profiles/xsession/polybar.nix b/profiles/xsession/polybar.nix index 5b0125b..02368f9 100644 --- a/profiles/xsession/polybar.nix +++ b/profiles/xsession/polybar.nix @@ -97,22 +97,19 @@ in ramp-signal-4 = ""; ramp-signal-foreground = "\${colors.foreground-alt}"; }; - "module/eth" = if (config.machine.eth != null) - then - { - type = "internal/network"; - interface = "${config.machine.eth}"; - interval = "3.0"; + "module/eth" = lib.mkIf (config.machine.eth != null) + { + type = "internal/network"; + interface = "${config.machine.eth}"; + interval = "3.0"; - format-connected-underline = "#55aa55"; - format-connected-prefix = " "; - format-connected-prefix-foreground = "\${colors.foreground-alt}"; - label-connected = "%local_ip%"; + format-connected-underline = "#55aa55"; + format-connected-prefix = " "; + format-connected-prefix-foreground = "\${colors.foreground-alt}"; + label-connected = "%local_ip%"; - format-disconnected = ""; - } - else - null; + format-disconnected = ""; + }; "module/filesystem" = { type = "internal/fs"; interval = 25;