From baae8c629296fa1c746320ed54a42cc78dc5d8ca Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 7 Sep 2024 23:20:24 -0400 Subject: [PATCH] cleanup --- home/sway.nix | 109 +++++++++++++++++++++++++------ home/terminal.nix | 2 +- modules/darwin/configuration.nix | 26 ++++---- modules/host-users.nix | 8 +-- modules/nixos/configuration.nix | 4 ++ 5 files changed, 110 insertions(+), 39 deletions(-) diff --git a/home/sway.nix b/home/sway.nix index f2bfc80..e923dd0 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -1,41 +1,112 @@ {pkgs, ...}: let dirs = { - defaults = ../../defaults; + defaults = ./defaults; }; in { wayland.windowManager.sway = { enable = pkgs.stdenv.isLinux; extraOptions = []; # Extra arguments to pass into sway. If sway goes haywire, we might need something in here xwayland = true; - systemd = true; + systemd.enable = true; # Install packages that will be installed with sway - extraPackages = with pkgs; [ - wl-clipboard - wofi - mako - wttrbar - light - brightnessctl - playerctl - grim - slurp - cliphist - ]; + # extraPackages = with pkgs; [ + # wl-clipboard + # wofi + # mako + # wttrbar + # light + # brightnessctl + # playerctl + # grim + # slurp + # cliphist + # ]; wrapperFeatures = { gtk = true; }; }; - xdg.configFile."sway/config".source = dirs.defaults + /sway/config; - programs.wofi.enable = pkgs.stdenv.isLinux; programs.waybar = { enable = pkgs.stdenv.isLinux; systemd.enable = true; - }; + style = '' + * { + border: none; + border-radius: 0; + font-family: "Monaspace Krypton"; + font-size: 13px; + min-height: 0; + } - xdg.configFile."waybar/config".source = dirs.defaults + /waybar/config.json; - xdg.configFile."waybar/style.css".source = dirs.defaults + /waybar/style.css; + window#waybar { + background: #1f2335; + border-bottom: 1px solid #24283b; + color: #c0caf5; + opacity: 0.808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808; + } + + #workspaces button { + padding: 5px; + padding-left: 12px; + padding-right: 12px; + background: transparent; + color: #c0caf5; + border-bottom: 1px solid transparent; + } + + #workspaces button.focused { + background: #c0caf5; + color: #1d2021; + border-bottom: 1px solid #c0caf5; + } + + #cpu, + #memory, + #pulseaudio, + #network, + #battery, + #clock, + #custom-playerctl { + padding: 0 10px; + margin: 0 5px; + } + + #battery.charging { + color: #9ece6a; + } + + #battery.warning:not(.charging) { + color: #ff9e64; + } + + @keyframes blink { + to { + background-color: #1d2021; + color: #ebdbb2; + } + } + + #battery.critical:not(.charging) { + background: #f7768e; + color: #ebdbb2; + border-bottom: 1px solid #ebdbb2; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #network.disconnected { + color: #cc241d; + } + + #pulseaudio.muted { + color: #cc241d; + } + ''; + }; } diff --git a/home/terminal.nix b/home/terminal.nix index ea519a5..b8d0b88 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -6,5 +6,5 @@ programs.kitty = { enable = false; # TODO: to enable later - } + }; } diff --git a/modules/darwin/configuration.nix b/modules/darwin/configuration.nix index 646da62..b394f80 100644 --- a/modules/darwin/configuration.nix +++ b/modules/darwin/configuration.nix @@ -53,9 +53,9 @@ # # If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat. # # This is very useful for vim users, they use `hjkl` to move cursor. # # sets how long it takes before it starts repeating. - InitialKeyRepeat = 15; # normal minimum is 15 (225 ms), maximum is 120 (1800 ms) + # InitialKeyRepeat = 15; # normal minimum is 15 (225 ms), maximum is 120 (1800 ms) # # sets how fast it repeats once it starts. - KeyRepeat = 3; # normal minimum is 2 (30 ms), maximum is 120 (1800 ms) + # KeyRepeat = 3; # normal minimum is 2 (30 ms), maximum is 120 (1800 ms) # NSAutomaticCapitalizationEnabled = false; # disable auto capitalization # NSAutomaticDashSubstitutionEnabled = false; # disable auto dash substitution @@ -130,19 +130,19 @@ # keyboard settings is not very useful on macOS # the most important thing is to remap option key to alt key globally, # but it's not supported by macOS yet. - keyboard = { - # enableKeyMapping = true; # enable key mapping so that we can use `option` as `control` + # keyboard = { + # enableKeyMapping = true; # enable key mapping so that we can use `option` as `control` - # # NOTE: do NOT support remap capslock to both control and escape at the same time - # remapCapsLockToControl = false; # remap caps lock to control, useful for emac users - remapCapsLockToEscape = true; # remap caps lock to escape, useful for vim users + # # NOTE: do NOT support remap capslock to both control and escape at the same time + # remapCapsLockToControl = false; # remap caps lock to control, useful for emac users + # remapCapsLockToEscape = true; # remap caps lock to escape, useful for vim users - # # swap left command and left alt - # # so it matches common keyboard layout: `ctrl | command | alt` - # # - # # disabled, caused only problems! - # swapLeftCommandAndLeftAlt = false; - }; + # # swap left command and left alt + # # so it matches common keyboard layout: `ctrl | command | alt` + # # + # # disabled, caused only problems! + # swapLeftCommandAndLeftAlt = false; + # }; }; # Add ability to used TouchID for sudo authentication diff --git a/modules/host-users.nix b/modules/host-users.nix index 5dc991e..bc78d23 100644 --- a/modules/host-users.nix +++ b/modules/host-users.nix @@ -7,10 +7,10 @@ # Set up networking configuration networking.hostName = hostname; networking.computerName = hostname; - networking.firewall.enable = true; # VERY important, do not touch + # networking.firewall.enable = true; # VERY important, do not touch # networking.firewall.allowedTCPPorts = []; # networking.firewall.allowedUDPPorts = []; - networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections + # networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections system.defaults.smb.NetBIOSName = hostname; # Set up user accounts @@ -21,10 +21,6 @@ then "/Users/${userName}" else "/home/${userName}"; description = userName; - extraGroups = - if pkgs.stdenv.isLinux - then ["wheel" "video"] - else []; }; nix.settings.trusted-users = [userName]; diff --git a/modules/nixos/configuration.nix b/modules/nixos/configuration.nix index 33741ba..781cd05 100644 --- a/modules/nixos/configuration.nix +++ b/modules/nixos/configuration.nix @@ -3,6 +3,7 @@ config, lib, pkgs, + userName, ... }: { # Bring in the hardware configuration @@ -114,4 +115,7 @@ remotePlay.openFirewall = true; localNetworkGameTransfers = true; }; + + # Add username to groups "wheel" and "video" - more may be added here later + users.users.${userName}.extraGroups = ["wheel" "video"]; }