From 78ee5c087f4939b7defa4ce51a8cd4dae7d2ad4b Mon Sep 17 00:00:00 2001 From: Jimbo Date: Fri, 13 Sep 2024 21:31:17 -0400 Subject: [PATCH] More formatting changes --- home-manager/sway/waybar.nix | 24 +++++++++++++++++++----- nixos/server/wireguard.nix | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/home-manager/sway/waybar.nix b/home-manager/sway/waybar.nix index 58e305e..44a633f 100644 --- a/home-manager/sway/waybar.nix +++ b/home-manager/sway/waybar.nix @@ -202,12 +202,26 @@ on-click = "makotoggle"; }; weatherModule = { - exec = pkgs.writeScript "weatherScript" '' + exec = let + weatherConf = pkgs.writeText "weather.jsonc" '' + { + "logo": { + "source": "none" + }, + "modules": [ + { + "type": "weather", + "outputFormat": "%0A%t%0A%C%0A%l" + } + ] + } + ''; + in pkgs.writeScript "weatherScript" '' # Fetch weather data - fetch=$(fastfetch -c all -s weather -l none | sed -E 's/Weather: ([^ ]+) - ([^ ]+ [^ ]+) (\(.*\))/\1\n\2\n\3/' | sed 's/^\+//') - temp=$(echo "$fetch" | sed -n '1p') - condition=$(echo "$fetch" | sed -n '2p') - location=$(echo "$fetch" | sed -n '3p' | sed 's/[()]//g') + fetch=$(fastfetch -c ${weatherConf}) + temp=$(echo "$fetch" | sed -n '2s/^\+//p') + condition=$(echo "$fetch" | sed -n '3p') + location=$(echo "$fetch" | sed -n '4p') # Map weather conditions to emojis case "$condition" in diff --git a/nixos/server/wireguard.nix b/nixos/server/wireguard.nix index 2b617f5..9155f51 100644 --- a/nixos/server/wireguard.nix +++ b/nixos/server/wireguard.nix @@ -16,7 +16,7 @@ in { interfaces = { # Wireguard interface name can be arbitrary wg0 = { - # Determines the IP address and subnet of the server's end of the tunnel interface. + # Determines the IP and subnet of the tunnel interface ips = [ "${ips.wgSpan}.1/24" ]; listenPort = 51820; privateKey = outputs.secrets.wireguardPriv;