diff options
-rw-r--r-- | machines/sternenseemann/wireguard.nix | 17 | ||||
-rw-r--r-- | modules/user/sternenseemann/services/sway.nix | 29 |
2 files changed, 46 insertions, 0 deletions
diff --git a/machines/sternenseemann/wireguard.nix b/machines/sternenseemann/wireguard.nix index b365dbe8..4011ee10 100644 --- a/machines/sternenseemann/wireguard.nix +++ b/machines/sternenseemann/wireguard.nix @@ -33,5 +33,22 @@ in }; }; }; + + vuizvui.user.sternenseemann.services.sway.extraStatus = builtins.listToAttrs ( + builtins.concatLists ( + builtins.map ( + iface: + builtins.map ( + ip: + { + name = "path_exists ${iface}${ip}"; + value = '' + path = "/proc/sys/net/ip${ip}/conf/${iface}" + ''; + } + ) [ "v4" "v6" ] + ) (builtins.attrNames config.networking.wg-quick.interfaces) + ) + ); }; } diff --git a/modules/user/sternenseemann/services/sway.nix b/modules/user/sternenseemann/services/sway.nix index 11048c49..e0f5eca3 100644 --- a/modules/user/sternenseemann/services/sway.nix +++ b/modules/user/sternenseemann/services/sway.nix @@ -132,6 +132,17 @@ in { Additional lines to append to the configuration. ''; }; + + extraStatus = lib.mkOption { + type = lib.types.attrsOf lib.types.lines; + default = {}; + description = "Additional i3status entries to prepend to the bar."; + example = { + "path_exists LOCK" = '' + path = "/run/lock" + ''; + }; + }; }; }; @@ -304,6 +315,13 @@ in { interval = 1 } + ${ + lib.concatStrings ( + lib.mapAttrsToList + (name: _: "order += \"${name}\"\n") + cfg.extraStatus + ) + } order += "volume master" order += "battery all" order += "tztime kalenderwoche" @@ -344,6 +362,17 @@ in { tztime offset { format = "%z" } + + ${ + lib.concatStrings ( + lib.mapAttrsToList (name: config: '' + ${name} { + ${builtins.replaceStrings [ "\n" ] [ "\n " ] config} + } + '' + ) cfg.extraStatus + ) + } ''; }; }; |