From b245a5c3b4fbeeb34c0fd0a42d5f839e560404b8 Mon Sep 17 00:00:00 2001 From: sioodmy Date: Tue, 30 Apr 2024 17:46:34 +0200 Subject: [PATCH] feat: fmt --- flake.nix | 2 +- home/rice/fuzzel.nix | 6 +- home/rice/niri/config.nix | 450 ++++++++++---------- home/rice/niri/default.nix | 26 +- home/rice/waybar/waybar-wttr.py | 159 +++---- hosts/default.nix | 5 +- hosts/prometheus/hardware-configuration.nix | 19 +- system/server/default.nix | 13 +- system/wayland/default.nix | 6 +- 9 files changed, 350 insertions(+), 336 deletions(-) diff --git a/flake.nix b/flake.nix index 9d085817..c65d08ca 100644 --- a/flake.nix +++ b/flake.nix @@ -96,7 +96,7 @@ impermanence.url = "github:nix-community/impermanence"; niri = { - url ="github:YaLTeR/niri"; + url = "github:YaLTeR/niri"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpak = { diff --git a/home/rice/fuzzel.nix b/home/rice/fuzzel.nix index 812cdd38..f5e23d14 100644 --- a/home/rice/fuzzel.nix +++ b/home/rice/fuzzel.nix @@ -1,6 +1,8 @@ -{ pkgs, theme, ...}: - { + pkgs, + theme, + ... +}: { programs.fuzzel = { enable = true; settings = { diff --git a/home/rice/niri/config.nix b/home/rice/niri/config.nix index a89d86f0..9ce21725 100644 --- a/home/rice/niri/config.nix +++ b/home/rice/niri/config.nix @@ -1,228 +1,228 @@ theme: with theme.colors; '' -input { - keyboard { - xkb { - layout "pl" - options "caps:escape" - } - } - - touchpad { - tap - natural-scroll - } - - warp-mouse-to-focus - focus-follows-mouse -} - -output "eDP-1" { - mode "1920x1080@120.0" - scale 1.0 - position x=0 y=0 - -} - -output "DP-2" { - scale 1.0 - mode "1920x1080@144.001" - - position x=0 y=-1080 -} - -layout { - gaps 16 - - center-focused-column "never" - - preset-column-widths { - proportion 0.33333 - proportion 0.5 - proportion 0.66667 - } - - default-column-width { proportion 0.5; } - - focus-ring { - width 2 - active-color "#${accent}" - inactive-color "#${overlay0}" - } -} - -spawn-at-startup "systemctl" "--user" "start" "niri.target" -// TODO: Find a better way -spawn-at-startup "systemctl" "--user" "restart" "swaybg.service" - -prefer-no-csd - -screenshot-path "~/pics/ss/ss%Y-%m-%d %H-%M-%S.png" - -window-rule { - match app-id="firefox" - default-column-width { proportion 1.0;} -} - -window-rule { - match app-id=r#"^org\.keepassxc\.KeePassXC$"# - match app-id=r#"^org\.gnome\.World\.Secrets$"# - block-out-from "screen-capture" -} - -window-rule { - match title="Firefox — Sharing Indicator" - max-width 0 - max-height 0 -} - -binds { - Mod+Shift+Slash { show-hotkey-overlay; } - - // Suggested binds for running programs: terminal, app launcher, screen locker. - Mod+Return { spawn "foot"; } - Mod+Space { spawn "fuzzel"; } - Super+Shift+L { spawn "swaylock"; } - - // You can also use a shell: - // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } - - // Example volume keys mappings for PipeWire & WirePlumber. - // The allow-when-locked=true property makes them work even when the session is locked. - XF86AudioRaiseVolume allow-when-locked=true { spawn "pamixer" "-i" "5"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "pamixer" "-d" "5"; } - XF86AudioMute allow-when-locked=true { spawn "pamixer" "-t"; } - XF86AudioMicMute allow-when-locked=true { spawn "micmute"; } - - XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "+5%"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; } - - Mod+Q { close-window; } - - Mod+Left { focus-column-left; } - Mod+Down { focus-window-down; } - Mod+Up { focus-window-up; } - Mod+Right { focus-column-right; } - Mod+H { focus-column-left; } - Mod+J { focus-window-down; } - Mod+K { focus-window-up; } - Mod+L { focus-column-right; } - - Mod+Ctrl+Left { move-column-left; } - Mod+Ctrl+Down { move-window-down; } - Mod+Ctrl+Up { move-window-up; } - Mod+Ctrl+Right { move-column-right; } - Mod+Ctrl+H { move-column-left; } - Mod+Ctrl+J { move-window-down; } - Mod+Ctrl+K { move-window-up; } - Mod+Ctrl+L { move-column-right; } - - // Alternative commands that move across workspaces when reaching - // the first or last window in a column. - // Mod+J { focus-window-or-workspace-down; } - // Mod+K { focus-window-or-workspace-up; } - // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } - // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } - - Mod+Home { focus-column-first; } - Mod+End { focus-column-last; } - Mod+Ctrl+Home { move-column-to-first; } - Mod+Ctrl+End { move-column-to-last; } - - Mod+Shift+Left { focus-monitor-left; } - Mod+Shift+Down { focus-monitor-down; } - Mod+Shift+Up { focus-monitor-up; } - Mod+Shift+Right { focus-monitor-right; } - Mod+Shift+H { focus-monitor-left; } - Mod+Shift+J { focus-monitor-down; } - Mod+Shift+K { focus-monitor-up; } - Mod+Shift+L { focus-monitor-right; } - - Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } - Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } - Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } - Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } - Mod+Shift+Ctrl+H { move-column-to-monitor-left; } - Mod+Shift+Ctrl+J { move-column-to-monitor-down; } - Mod+Shift+Ctrl+K { move-column-to-monitor-up; } - Mod+Shift+Ctrl+L { move-column-to-monitor-right; } - - Mod+Page_Down { focus-workspace-down; } - Mod+Page_Up { focus-workspace-up; } - Mod+U { focus-workspace-down; } - Mod+I { focus-workspace-up; } - Mod+Ctrl+Page_Down { move-column-to-workspace-down; } - Mod+Ctrl+Page_Up { move-column-to-workspace-up; } - Mod+Ctrl+U { move-column-to-workspace-down; } - Mod+Ctrl+I { move-column-to-workspace-up; } - - Mod+Shift+Page_Down { move-workspace-down; } - Mod+Shift+Page_Up { move-workspace-up; } - Mod+Shift+U { move-workspace-down; } - Mod+Shift+I { move-workspace-up; } - - Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } - Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } - Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } - Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } - - Mod+WheelScrollRight { focus-column-right; } - Mod+WheelScrollLeft { focus-column-left; } - Mod+Ctrl+WheelScrollRight { move-column-right; } - Mod+Ctrl+WheelScrollLeft { move-column-left; } - - Mod+Shift+WheelScrollDown { focus-column-right; } - Mod+Shift+WheelScrollUp { focus-column-left; } - Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } - Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } - - Mod+1 { focus-workspace 1; } - Mod+2 { focus-workspace 2; } - Mod+3 { focus-workspace 3; } - Mod+4 { focus-workspace 4; } - Mod+5 { focus-workspace 5; } - Mod+6 { focus-workspace 6; } - Mod+7 { focus-workspace 7; } - Mod+8 { focus-workspace 8; } - Mod+9 { focus-workspace 9; } - Mod+Ctrl+1 { move-column-to-workspace 1; } - Mod+Ctrl+2 { move-column-to-workspace 2; } - Mod+Ctrl+3 { move-column-to-workspace 3; } - Mod+Ctrl+4 { move-column-to-workspace 4; } - Mod+Ctrl+5 { move-column-to-workspace 5; } - Mod+Ctrl+6 { move-column-to-workspace 6; } - Mod+Ctrl+7 { move-column-to-workspace 7; } - Mod+Ctrl+8 { move-column-to-workspace 8; } - Mod+Ctrl+9 { move-column-to-workspace 9; } - - // Alternatively, there are commands to move just a single window: - // Mod+Ctrl+1 { move-window-to-workspace 1; } - - // Switches focus between the current and the previous workspace. - // Mod+Tab { focus-workspace-previous; } - - Mod+Comma { consume-window-into-column; } - Mod+Period { expel-window-from-column; } - - // There are also commands that consume or expel a single window to the side. - // Mod+BracketLeft { consume-or-expel-window-left; } - // Mod+BracketRight { consume-or-expel-window-right; } - - Mod+R { switch-preset-column-width; } - Mod+F { maximize-column; } - Mod+Shift+F { fullscreen-window; } - Mod+C { center-column; } - - Mod+Minus { set-column-width "-10%"; } - Mod+Equal { set-column-width "+10%"; } - - Mod+Shift+Minus { set-window-height "-10%"; } - Mod+Shift+Equal { set-window-height "+10%"; } - - Super+Print { screenshot; } - Ctrl+Print { screenshot-screen; } - Alt+Print { screenshot-window; } - - Mod+Shift+P { power-off-monitors; } -} + input { + keyboard { + xkb { + layout "pl" + options "caps:escape" + } + } + + touchpad { + tap + natural-scroll + } + + warp-mouse-to-focus + focus-follows-mouse + } + + output "eDP-1" { + mode "1920x1080@120.0" + scale 1.0 + position x=0 y=0 + + } + + output "DP-2" { + scale 1.0 + mode "1920x1080@144.001" + + position x=0 y=-1080 + } + + layout { + gaps 16 + + center-focused-column "never" + + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + + default-column-width { proportion 0.5; } + + focus-ring { + width 2 + active-color "#${accent}" + inactive-color "#${overlay0}" + } + } + + spawn-at-startup "systemctl" "--user" "start" "niri.target" + // TODO: Find a better way + spawn-at-startup "systemctl" "--user" "restart" "swaybg.service" + + prefer-no-csd + + screenshot-path "~/pics/ss/ss%Y-%m-%d %H-%M-%S.png" + + window-rule { + match app-id="firefox" + default-column-width { proportion 1.0;} + } + + window-rule { + match app-id=r#"^org\.keepassxc\.KeePassXC$"# + match app-id=r#"^org\.gnome\.World\.Secrets$"# + block-out-from "screen-capture" + } + + window-rule { + match title="Firefox — Sharing Indicator" + max-width 0 + max-height 0 + } + + binds { + Mod+Shift+Slash { show-hotkey-overlay; } + + // Suggested binds for running programs: terminal, app launcher, screen locker. + Mod+Return { spawn "foot"; } + Mod+Space { spawn "fuzzel"; } + Super+Shift+L { spawn "swaylock"; } + + // You can also use a shell: + // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } + + // Example volume keys mappings for PipeWire & WirePlumber. + // The allow-when-locked=true property makes them work even when the session is locked. + XF86AudioRaiseVolume allow-when-locked=true { spawn "pamixer" "-i" "5"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "pamixer" "-d" "5"; } + XF86AudioMute allow-when-locked=true { spawn "pamixer" "-t"; } + XF86AudioMicMute allow-when-locked=true { spawn "micmute"; } + + XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "+5%"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; } + + Mod+Q { close-window; } + + Mod+Left { focus-column-left; } + Mod+Down { focus-window-down; } + Mod+Up { focus-window-up; } + Mod+Right { focus-column-right; } + Mod+H { focus-column-left; } + Mod+J { focus-window-down; } + Mod+K { focus-window-up; } + Mod+L { focus-column-right; } + + Mod+Ctrl+Left { move-column-left; } + Mod+Ctrl+Down { move-window-down; } + Mod+Ctrl+Up { move-window-up; } + Mod+Ctrl+Right { move-column-right; } + Mod+Ctrl+H { move-column-left; } + Mod+Ctrl+J { move-window-down; } + Mod+Ctrl+K { move-window-up; } + Mod+Ctrl+L { move-column-right; } + + // Alternative commands that move across workspaces when reaching + // the first or last window in a column. + // Mod+J { focus-window-or-workspace-down; } + // Mod+K { focus-window-or-workspace-up; } + // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } + // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + + Mod+Home { focus-column-first; } + Mod+End { focus-column-last; } + Mod+Ctrl+Home { move-column-to-first; } + Mod+Ctrl+End { move-column-to-last; } + + Mod+Shift+Left { focus-monitor-left; } + Mod+Shift+Down { focus-monitor-down; } + Mod+Shift+Up { focus-monitor-up; } + Mod+Shift+Right { focus-monitor-right; } + Mod+Shift+H { focus-monitor-left; } + Mod+Shift+J { focus-monitor-down; } + Mod+Shift+K { focus-monitor-up; } + Mod+Shift+L { focus-monitor-right; } + + Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } + Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } + Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } + Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } + Mod+Shift+Ctrl+H { move-column-to-monitor-left; } + Mod+Shift+Ctrl+J { move-column-to-monitor-down; } + Mod+Shift+Ctrl+K { move-column-to-monitor-up; } + Mod+Shift+Ctrl+L { move-column-to-monitor-right; } + + Mod+Page_Down { focus-workspace-down; } + Mod+Page_Up { focus-workspace-up; } + Mod+U { focus-workspace-down; } + Mod+I { focus-workspace-up; } + Mod+Ctrl+Page_Down { move-column-to-workspace-down; } + Mod+Ctrl+Page_Up { move-column-to-workspace-up; } + Mod+Ctrl+U { move-column-to-workspace-down; } + Mod+Ctrl+I { move-column-to-workspace-up; } + + Mod+Shift+Page_Down { move-workspace-down; } + Mod+Shift+Page_Up { move-workspace-up; } + Mod+Shift+U { move-workspace-down; } + Mod+Shift+I { move-workspace-up; } + + Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } + Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } + Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } + Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } + + Mod+WheelScrollRight { focus-column-right; } + Mod+WheelScrollLeft { focus-column-left; } + Mod+Ctrl+WheelScrollRight { move-column-right; } + Mod+Ctrl+WheelScrollLeft { move-column-left; } + + Mod+Shift+WheelScrollDown { focus-column-right; } + Mod+Shift+WheelScrollUp { focus-column-left; } + Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } + Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } + + Mod+1 { focus-workspace 1; } + Mod+2 { focus-workspace 2; } + Mod+3 { focus-workspace 3; } + Mod+4 { focus-workspace 4; } + Mod+5 { focus-workspace 5; } + Mod+6 { focus-workspace 6; } + Mod+7 { focus-workspace 7; } + Mod+8 { focus-workspace 8; } + Mod+9 { focus-workspace 9; } + Mod+Ctrl+1 { move-column-to-workspace 1; } + Mod+Ctrl+2 { move-column-to-workspace 2; } + Mod+Ctrl+3 { move-column-to-workspace 3; } + Mod+Ctrl+4 { move-column-to-workspace 4; } + Mod+Ctrl+5 { move-column-to-workspace 5; } + Mod+Ctrl+6 { move-column-to-workspace 6; } + Mod+Ctrl+7 { move-column-to-workspace 7; } + Mod+Ctrl+8 { move-column-to-workspace 8; } + Mod+Ctrl+9 { move-column-to-workspace 9; } + + // Alternatively, there are commands to move just a single window: + // Mod+Ctrl+1 { move-window-to-workspace 1; } + + // Switches focus between the current and the previous workspace. + // Mod+Tab { focus-workspace-previous; } + + Mod+Comma { consume-window-into-column; } + Mod+Period { expel-window-from-column; } + + // There are also commands that consume or expel a single window to the side. + // Mod+BracketLeft { consume-or-expel-window-left; } + // Mod+BracketRight { consume-or-expel-window-right; } + + Mod+R { switch-preset-column-width; } + Mod+F { maximize-column; } + Mod+Shift+F { fullscreen-window; } + Mod+C { center-column; } + + Mod+Minus { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } + + Mod+Shift+Minus { set-window-height "-10%"; } + Mod+Shift+Equal { set-window-height "+10%"; } + + Super+Print { screenshot; } + Ctrl+Print { screenshot-screen; } + Alt+Print { screenshot-window; } + + Mod+Shift+P { power-off-monitors; } + } '' diff --git a/home/rice/niri/default.nix b/home/rice/niri/default.nix index aea405e9..0ebe4831 100644 --- a/home/rice/niri/default.nix +++ b/home/rice/niri/default.nix @@ -3,18 +3,16 @@ lib, theme, ... -}: -let +}: let mkService = lib.recursiveUpdate { Unit.PartOf = ["graphical-session.target"]; Unit.After = ["graphical-session.target"]; Install.WantedBy = ["graphical-session.target"]; }; in { - -home.packages = with pkgs;[pamixer]; -xdg.configFile."niri/config.kdl".text = import ./config.nix theme; -services = { + home.packages = with pkgs; [pamixer]; + xdg.configFile."niri/config.kdl".text = import ./config.nix theme; + services = { wlsunset = { # TODO: fix opaque red screen issue enable = true; @@ -31,17 +29,17 @@ services = { # fake a tray to let apps start # https://github.com/nix-community/home-manager/issues/2064 tray = { - Unit = { - Description = "Home Manager System Tray"; - Requires = ["graphical-session-pre.target"]; - }; + Unit = { + Description = "Home Manager System Tray"; + Requires = ["graphical-session-pre.target"]; }; + }; niri = { - Unit = { - Description = "Niri"; - Requires = ["graphical-session-pre.target"]; - }; + Unit = { + Description = "Niri"; + Requires = ["graphical-session-pre.target"]; }; + }; }; systemd.user.services = { diff --git a/home/rice/waybar/waybar-wttr.py b/home/rice/waybar/waybar-wttr.py index bc3a7ae6..a2821439 100644 --- a/home/rice/waybar/waybar-wttr.py +++ b/home/rice/waybar/waybar-wttr.py @@ -5,54 +5,54 @@ from datetime import datetime WEATHER_CODES = { - '113': '☀️ ', - '116': '⛅ ', - '119': '☁️ ', - '122': '☁️ ', - '143': '☁️ ', - '176': '🌧️', - '179': '🌧️', - '182': '🌧️', - '185': '🌧️', - '200': '⛈️ ', - '227': '🌨️', - '230': '🌨️', - '248': '☁️ ', - '260': '☁️ ', - '263': '🌧️', - '266': '🌧️', - '281': '🌧️', - '284': '🌧️', - '293': '🌧️', - '296': '🌧️', - '299': '🌧️', - '302': '🌧️', - '305': '🌧️', - '308': '🌧️', - '311': '🌧️', - '314': '🌧️', - '317': '🌧️', - '320': '🌨️', - '323': '🌨️', - '326': '🌨️', - '329': '❄️ ', - '332': '❄️ ', - '335': '❄️ ', - '338': '❄️ ', - '350': '🌧️', - '353': '🌧️', - '356': '🌧️', - '359': '🌧️', - '362': '🌧️', - '365': '🌧️', - '368': '🌧️', - '371': '❄️', - '374': '🌨️', - '377': '🌨️', - '386': '🌨️', - '389': '🌨️', - '392': '🌧️', - '395': '❄️ ' + "113": "☀️ ", + "116": "⛅ ", + "119": "☁️ ", + "122": "☁️ ", + "143": "☁️ ", + "176": "🌧️", + "179": "🌧️", + "182": "🌧️", + "185": "🌧️", + "200": "⛈️ ", + "227": "🌨️", + "230": "🌨️", + "248": "☁️ ", + "260": "☁️ ", + "263": "🌧️", + "266": "🌧️", + "281": "🌧️", + "284": "🌧️", + "293": "🌧️", + "296": "🌧️", + "299": "🌧️", + "302": "🌧️", + "305": "🌧️", + "308": "🌧️", + "311": "🌧️", + "314": "🌧️", + "317": "🌧️", + "320": "🌨️", + "323": "🌨️", + "326": "🌨️", + "329": "❄️ ", + "332": "❄️ ", + "335": "❄️ ", + "338": "❄️ ", + "350": "🌧️", + "353": "🌧️", + "356": "🌧️", + "359": "🌧️", + "362": "🌧️", + "365": "🌧️", + "368": "🌧️", + "371": "❄️", + "374": "🌨️", + "377": "🌨️", + "386": "🌨️", + "389": "🌨️", + "392": "🌧️", + "395": "❄️ ", } data = {} @@ -66,7 +66,7 @@ def format_time(time): def format_temp(temp): - return (hour['FeelsLikeC']+"°").ljust(3) + return (hour["FeelsLikeC"] + "°").ljust(3) def format_chances(hour): @@ -78,42 +78,55 @@ def format_chances(hour): "chanceofsnow": "Snow", "chanceofsunshine": "Sunshine", "chanceofthunder": "Thunder", - "chanceofwindy": "Wind" + "chanceofwindy": "Wind", } conditions = [] for event in chances.keys(): if int(hour[event]) > 0: - conditions.append(chances[event]+" "+hour[event]+"%") + conditions.append(chances[event] + " " + hour[event] + "%") return ", ".join(conditions) -tempint = int(weather['current_condition'][0]['FeelsLikeC']) -extrachar = '' -if tempint >= 0 and tempint < 10: - extrachar = '+' - -data['text'] = ' '+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ - "\n "+extrachar+weather['current_condition'][0]['FeelsLikeC']+"°" - -data['tooltip'] = f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°\n" -data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n" -data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" -data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" -for i, day in enumerate(weather['weather']): - data['tooltip'] += f"\n" +tempint = int(weather["current_condition"][0]["FeelsLikeC"]) +extrachar = "" +if tempint >= 0 and tempint < 10: + extrachar = "+" + + +data["text"] = ( + " " + + WEATHER_CODES[weather["current_condition"][0]["weatherCode"]] + + "\n " + + extrachar + + weather["current_condition"][0]["FeelsLikeC"] + + "°" +) + +data["tooltip"] = ( + f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°\n" +) +data["tooltip"] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n" +data["tooltip"] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" +data["tooltip"] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" +for i, day in enumerate(weather["weather"]): + data["tooltip"] += f"\n" if i == 0: - data['tooltip'] += "Today, " + data["tooltip"] += "Today, " if i == 1: - data['tooltip'] += "Tomorrow, " - data['tooltip'] += f"{day['date']}\n" - data['tooltip'] += f"⬆️ {day['maxtempC']}° ⬇️ {day['mintempC']}° " - data['tooltip'] += f"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\n" - for hour in day['hourly']: + data["tooltip"] += "Tomorrow, " + data["tooltip"] += f"{day['date']}\n" + data["tooltip"] += f"⬆️ {day['maxtempC']}° ⬇️ {day['mintempC']}° " + data[ + "tooltip" + ] += f"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\n" + for hour in day["hourly"]: if i == 0: - if int(format_time(hour['time'])) < datetime.now().hour-2: + if int(format_time(hour["time"])) < datetime.now().hour - 2: continue - data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" + data[ + "tooltip" + ] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" print(json.dumps(data)) diff --git a/hosts/default.nix b/hosts/default.nix index b70d9d3e..82b24cae 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -73,8 +73,9 @@ in { system = "x86_64-linux"; modules = [ - {networking.hostName = "prometheus"; - boot.loader.grub.devices = [ "/dev/sda" ]; + { + networking.hostName = "prometheus"; + boot.loader.grub.devices = ["/dev/sda"]; } server ./prometheus diff --git a/hosts/prometheus/hardware-configuration.nix b/hosts/prometheus/hardware-configuration.nix index ae19a544..31629667 100644 --- a/hosts/prometheus/hardware-configuration.nix +++ b/hosts/prometheus/hardware-configuration.nix @@ -5,16 +5,14 @@ }: { imports = [(modulesPath + "/profiles/qemu-guest.nix")]; - - boot.initrd.availableKernelModules = - [ - "ata_piix" - "virtio_pci" - "virtio_scsi" - "xhci_pci" - "sd_mod" - "sr_mod" - ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "virtio_pci" + "virtio_scsi" + "xhci_pci" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = []; boot.kernelModules = []; boot.extraModulePackages = []; @@ -25,5 +23,4 @@ }; swapDevices = []; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - } diff --git a/system/server/default.nix b/system/server/default.nix index 67b2f525..1016a3c2 100644 --- a/system/server/default.nix +++ b/system/server/default.nix @@ -5,7 +5,7 @@ }: # TODO { -imports = [inputs.schizosearch.nixosModules.default]; + imports = [inputs.schizosearch.nixosModules.default]; services.nginx = { enable = true; # package = pkgs.nginx.override {openssl = pkgs.libressl;}; @@ -15,11 +15,11 @@ imports = [inputs.schizosearch.nixosModules.default]; # sslCiphers = "EECDH+aRSA+AESGCM:EDH+aRSA:EECDH+aRSA:+AES256:+AES128:+SHA1:!CAMELLIA:!SEED:!3DES:!DES:!RC4:!eNULL"; # sslProtocols = "TLSv1.3 TLSv1.2"; - virtualHosts = { - "sioodmy.dev" = { - root = "${inputs.sioodmy-dev.packages.${pkgs.system}.website}/"; - enableACME = true; - forceSSL = true; + virtualHosts = { + "sioodmy.dev" = { + root = "${inputs.sioodmy-dev.packages.${pkgs.system}.website}/"; + enableACME = true; + forceSSL = true; }; "search.sioodmy.dev" = { locations."/" = { @@ -48,5 +48,4 @@ imports = [inputs.schizosearch.nixosModules.default]; allowedUDPPorts = [51820 5232]; allowedTCPPorts = [5232 80 3000]; }; - } diff --git a/system/wayland/default.nix b/system/wayland/default.nix index 254f9f0f..14e3aae1 100644 --- a/system/wayland/default.nix +++ b/system/wayland/default.nix @@ -1,4 +1,8 @@ -{pkgs, inputs, ...}: { +{ + pkgs, + inputs, + ... +}: { imports = [./fonts.nix ./services.nix ./pipewire.nix]; environment.etc."greetd/environments".text = '' niri --session