From e6d3e90d4d983fafe6318e899a886911c30edd49 Mon Sep 17 00:00:00 2001 From: "Geir O. Jerstad" Date: Fri, 4 Jul 2025 22:27:40 +0200 Subject: [PATCH 1/2] waybar nix config --- machines/little-rascal/configuration.nix | 6 +- modules/desktop/waybar.nix | 153 +++++++++++++++++++++++ 2 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 modules/desktop/waybar.nix diff --git a/machines/little-rascal/configuration.nix b/machines/little-rascal/configuration.nix index 4fe64e0..1ef4c38 100644 --- a/machines/little-rascal/configuration.nix +++ b/machines/little-rascal/configuration.nix @@ -1,5 +1,4 @@ # Little Rascal - Development Laptop Configuration -# Based on congenital-optimist with laptop-specific adjustments { config, pkgs, @@ -18,7 +17,8 @@ # Desktop ../../modules/desktop/niri.nix - ../../modules/desktop/cosmic.nix + ../../modules/desktop/waybar.nix + ../../modules/desktop/gnome.nix ../../modules/desktop/fonts.nix ../../modules/desktop/input.nix @@ -54,7 +54,6 @@ hostName = "little-rascal"; networkmanager.enable = true; - # Tailscale for home lab access firewall = { enable = true; allowedUDPPorts = [41641]; # Tailscale @@ -73,7 +72,6 @@ kernelModules = ["kvm-amd" "zram"]; tmp.cleanOnBoot = true; - # zram swap like other machines kernel.sysctl."vm.swappiness" = 180; }; diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix new file mode 100644 index 0000000..a557778 --- /dev/null +++ b/modules/desktop/waybar.nix @@ -0,0 +1,153 @@ +{ + config, + pkgs, + ... +}: { + # Ensure waybar is installed + environment.systemPackages = with pkgs; [waybar]; + + programs.waybar = { + enable = true; + settings = { + layer = "top"; + position = "top"; + height = 30; + spacing = 4; + modules-left = ["sway/workspaces"]; + modules-center = []; + modules-right = ["network" "clock"]; + "sway/workspaces" = { + disable-scroll = false; + all-outputs = true; + format = "{name}"; + format-icons = { + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + urgent = ""; + focused = ""; + default = ""; + }; + }; + clock = { + timezone = "Europe/Oslo"; + format = "{:%H:%M}"; + format-alt = "{:%Y-%m-%d %H:%M:%S}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + }; + network = { + format-wifi = "{essid} ({signalStrength}%) "; + format-ethernet = "{ipaddr}/{cidr} "; + tooltip-format = "{ifname} via {gwaddr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + }; + style = '' + * { + border: none; + border-radius: 0; + font-family: 'Inter', 'Font Awesome 6 Free'; + font-size: 13px; + min-height: 0; + } + + window#waybar { + background-color: rgba(43, 48, 59, 0.9); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: 0.5s; + } + + window#waybar.hidden { + opacity: 0.2; + } + + #workspaces { + margin: 0 4px; + } + + #workspaces button { + padding: 0 8px; + background-color: transparent; + color: #ffffff; + border-bottom: 3px solid transparent; + transition: all 0.3s ease; + } + + #workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + } + + #workspaces button.focused { + background-color: #64727D; + border-bottom: 3px solid #ffffff; + } + + #workspaces button.urgent { + background-color: #eb4d4b; + color: #ffffff; + } + + #clock, + #network { + padding: 0 10px; + color: #ffffff; + } + + #clock { + background-color: #64727D; + border-radius: 0 8px 8px 0; + } + + #network { + background-color: #2980b9; + border-radius: 8px 0 0 8px; + } + + #network.disconnected { + background-color: #f53c3c; + } + + @keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } + } + + #network.disconnected { + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + ''; + }; +} From f323e3b909c3fb1638042ebe349df3511bd9dd13 Mon Sep 17 00:00:00 2001 From: "Geir O. Jerstad" Date: Fri, 4 Jul 2025 23:14:16 +0200 Subject: [PATCH 2/2] tring to get laptop to work --- machines/little-rascal/configuration.nix | 24 +- .../little-rascal/hardware-configuration.nix | 8 +- modules/desktop/waybar.nix | 264 +++++++++--------- 3 files changed, 150 insertions(+), 146 deletions(-) diff --git a/machines/little-rascal/configuration.nix b/machines/little-rascal/configuration.nix index 1ef4c38..33d4c56 100644 --- a/machines/little-rascal/configuration.nix +++ b/machines/little-rascal/configuration.nix @@ -19,6 +19,7 @@ ../../modules/desktop/niri.nix ../../modules/desktop/waybar.nix ../../modules/desktop/gnome.nix + ../../modules/desktop/cosmic.nix ../../modules/desktop/fonts.nix ../../modules/desktop/input.nix @@ -47,7 +48,7 @@ ../../modules/security/ssh-keys.nix # Services - ../../modules/services/seatd.nix + #../../modules/services/seatd.nix ]; networking = { @@ -98,22 +99,23 @@ # Laptop-specific services services = { - # Enable clean seatd/greetd login - seatd-clean.enable = true; + xserver.displayManager.gdm.enable = true; + xserver.displayManager.gdm.wayland = true; # Enable Wayland support + # Enable clean seatd/greetd login (seat management for Wayland compositors) + # seatd-clean.enable = true; - # Power management for laptop - power-profiles-daemon.enable = true; - upower.enable = true; + # power-profiles-daemon.enable = true; + # upower.enable = true; - # Essential services tailscale.enable = true; - blueman.enable = true; + # Bluetooth manager GUI + # blueman.enable = true; - # Firmware updates + # Firmware updates via fwupd fwupd.enable = true; - # Location services for time zone - geoclue2.enable = true; + # Location services (used for automatic time zone, etc.) + # geoclue2.enable = true; }; # Localization diff --git a/machines/little-rascal/hardware-configuration.nix b/machines/little-rascal/hardware-configuration.nix index 9cd1666..c4a0425 100644 --- a/machines/little-rascal/hardware-configuration.nix +++ b/machines/little-rascal/hardware-configuration.nix @@ -62,10 +62,10 @@ }; # Bluetooth support for Intel AX200 - bluetooth = { - enable = true; - powerOnBoot = true; - }; + # bluetooth = { + # enable = true; + # powerOnBoot = true; + # }; }; # Power management for AMD Ryzen 7 4700U diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index a557778..61c5d7e 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -6,148 +6,150 @@ # Ensure waybar is installed environment.systemPackages = with pkgs; [waybar]; - programs.waybar = { - enable = true; - settings = { - layer = "top"; - position = "top"; - height = 30; - spacing = 4; - modules-left = ["sway/workspaces"]; - modules-center = []; - modules-right = ["network" "clock"]; - "sway/workspaces" = { - disable-scroll = false; - all-outputs = true; - format = "{name}"; - format-icons = { - "1" = "1"; - "2" = "2"; - "3" = "3"; - "4" = "4"; - "5" = "5"; - urgent = ""; - focused = ""; - default = ""; - }; - }; - clock = { - timezone = "Europe/Oslo"; - format = "{:%H:%M}"; - format-alt = "{:%Y-%m-%d %H:%M:%S}"; - tooltip-format = "{calendar}"; - calendar = { - mode = "year"; - mode-mon-col = 3; - weeks-pos = "right"; - on-scroll = 1; - on-click-right = "mode"; - format = { - months = "{}"; - days = "{}"; - weeks = "W{}"; - weekdays = "{}"; - today = "{}"; - }; - }; - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_up"; - on-scroll-down = "shift_down"; - }; - }; - network = { - format-wifi = "{essid} ({signalStrength}%) "; - format-ethernet = "{ipaddr}/{cidr} "; - tooltip-format = "{ifname} via {gwaddr} "; - format-linked = "{ifname} (No IP) "; - format-disconnected = "Disconnected ⚠"; - format-alt = "{ifname}: {ipaddr}/{cidr}"; - }; - }; - style = '' - * { - border: none; - border-radius: 0; - font-family: 'Inter', 'Font Awesome 6 Free'; - font-size: 13px; - min-height: 0; - } + # Configure Waybar + environment.etc."xdg/waybar/config".text = '' + { + "layer": "top", + "position": "top", + "height": 30, + "spacing": 4, + "modules-left": ["sway/workspaces"], + "modules-center": [], + "modules-right": ["network", "clock"], + "sway/workspaces": { + "disable-scroll": false, + "all-outputs": true, + "format": "{name}", + "format-icons": { + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "urgent": "", + "focused": "", + "default": "" + } + }, + "clock": { + "timezone": "Europe/Oslo", + "format": "{:%H:%M}", + "format-alt": "{:%Y-%m-%d %H:%M:%S}", + "tooltip-format": "{calendar}", + "calendar": { + "mode": "year", + "mode-mon-col": 3, + "weeks-pos": "right", + "on-scroll": 1, + "on-click-right": "mode", + "format": { + "months": "{}", + "days": "{}", + "weeks": "W{}", + "weekdays": "{}", + "today": "{}" + } + }, + "actions": { + "on-click-right": "mode", + "on-click-forward": "tz_up", + "on-click-backward": "tz_down", + "on-scroll-up": "shift_up", + "on-scroll-down": "shift_down" + } + }, + "network": { + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + } + } + ''; - window#waybar { - background-color: rgba(43, 48, 59, 0.9); - border-bottom: 3px solid rgba(100, 114, 125, 0.5); - color: #ffffff; - transition-property: background-color; - transition-duration: 0.5s; - } + # Style for Waybar + environment.etc."xdg/waybar/style.css".text = '' + * { + border: none; + border-radius: 0; + font-family: 'Inter', 'Font Awesome 6 Free'; + font-size: 13px; + min-height: 0; + } - window#waybar.hidden { - opacity: 0.2; - } + window#waybar { + background-color: rgba(43, 48, 59, 0.9); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: 0.5s; + } - #workspaces { - margin: 0 4px; - } + window#waybar.hidden { + opacity: 0.2; + } - #workspaces button { - padding: 0 8px; - background-color: transparent; - color: #ffffff; - border-bottom: 3px solid transparent; - transition: all 0.3s ease; - } + #workspaces { + margin: 0 4px; + } - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - } + #workspaces button { + padding: 0 8px; + background-color: transparent; + color: #ffffff; + border-bottom: 3px solid transparent; + transition: all 0.3s ease; + } - #workspaces button.focused { - background-color: #64727D; - border-bottom: 3px solid #ffffff; - } + #workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + } - #workspaces button.urgent { - background-color: #eb4d4b; - color: #ffffff; - } + #workspaces button.focused { + background-color: #64727D; + border-bottom: 3px solid #ffffff; + } - #clock, - #network { - padding: 0 10px; - color: #ffffff; - } + #workspaces button.urgent { + background-color: #eb4d4b; + color: #ffffff; + } - #clock { - background-color: #64727D; - border-radius: 0 8px 8px 0; - } + #clock, + #network { + padding: 0 10px; + color: #ffffff; + } - #network { - background-color: #2980b9; - border-radius: 8px 0 0 8px; - } + #clock { + background-color: #64727D; + border-radius: 0 8px 8px 0; + } - #network.disconnected { - background-color: #f53c3c; - } + #network { + background-color: #2980b9; + border-radius: 8px 0 0 8px; + } - @keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } - } + #network.disconnected { + background-color: #f53c3c; + } - #network.disconnected { - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - ''; - }; + @keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } + } + + #network.disconnected { + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + ''; }