From a1196deb25b134e6e04af18bd101050dc05c0311 Mon Sep 17 00:00:00 2001 From: wo2wz <189177184+wo2wz@users.noreply.github.com> Date: Fri, 1 Aug 2025 00:36:00 -0400 Subject: [PATCH] remove all default packages, add btop configs, update ssh local ips, add multiple programs to niri config and add more keybinds --- common/default.nix | 4 +- hosts/Earthmover/default.nix | 9 ++ hosts/Swordsmachine/default.nix | 21 ++-- modules/common/niri.nix | 166 ++++++++++++++++++++++++++------ modules/common/stylix.nix | 22 ++++- modules/home/btop.nix | 11 +++ modules/home/default.nix | 1 + modules/nixos/ssh.nix | 4 +- 8 files changed, 191 insertions(+), 47 deletions(-) create mode 100644 modules/home/btop.nix diff --git a/common/default.nix b/common/default.nix index 036937f..5aa7930 100755 --- a/common/default.nix +++ b/common/default.nix @@ -14,7 +14,7 @@ environment = { systemPackages = with pkgs; [ wget ]; - # remove perl from default packages - defaultPackages = with pkgs; lib.mkForce [ rsync strace ]; + # remove default packages + defaultPackages = lib.mkForce [ ]; }; } \ No newline at end of file diff --git a/hosts/Earthmover/default.nix b/hosts/Earthmover/default.nix index 742827d..a7262e1 100755 --- a/hosts/Earthmover/default.nix +++ b/hosts/Earthmover/default.nix @@ -17,6 +17,15 @@ ../../modules/home ]; + programs.btop = { + package = pkgs.btop-rocm; + settings = { + shown_boxes = "cpu mem net proc gpu0"; + custom_cpu_name = "Core i5-12400F"; + custom_gpu_name0 = "RX 6700 XT"; + }; + }; + home.file.".config/Yubico/u2f_keys".text = "wo2w:z53Q2IqyzYjUP22RRDsf+vfD9x+AJ1ymrOFslox0IeqHCHC5JecjjtQFGYwUPkP7KG7sEQ52ZG4ZhXxSg8/UZw==,8CnIjGYN5vD+jDyk4I4HQzUDJ5eMjcZ+s2209O76u/gynbPKAXX+U7/vrWHNqKz6YqHCpvD9KpJlLbzNh/xJJg==,es256,+presence"; home.stateVersion = "25.05"; diff --git a/hosts/Swordsmachine/default.nix b/hosts/Swordsmachine/default.nix index dc80b64..96d3f2c 100755 --- a/hosts/Swordsmachine/default.nix +++ b/hosts/Swordsmachine/default.nix @@ -25,22 +25,23 @@ }; environment.systemPackages = with pkgs; [ - # necessary to make the camera not look like the sun - cameractrls - # for key replacement macros - xautomation + cameractrls # necessary to make the camera not look like the sun + xautomation # for key replacement macros ]; - home-manager.users.wo2w = - let - ifHomeProgramEnable = - name: - if config.programs.${name}.enable then true else false; - in { + home-manager.users.wo2w = { imports = [ ../../modules/home ]; + programs.btop = { + package = pkgs.btop-cuda; + settings = { + shown_boxes = "cpu mem net proc gpu0"; + custom_cpu_name = "Core i7-8750H"; + }; + }; + home.file = { # yubikey config ".config/Yubico/u2f_keys".text = "wo2w:aKYaBOjCImRE58XcYJCqxpY0vABEIYWbk2Lvx4UqnN3M/A1uyr3boV4FZLkfxUwmlfBdMDm4caSaX1/SrNoNgw==,zruscj30G6zEt8xmlvTXBBEKIzg+fPCSq/FvhZO3X0HyP2uBLsWSXqCyRKXM8H9F/GJwJWBpyoHj/dhkxj7eZg==,es256,+presence"; diff --git a/modules/common/niri.nix b/modules/common/niri.nix index 6199b56..3f81f8a 100755 --- a/modules/common/niri.nix +++ b/modules/common/niri.nix @@ -1,31 +1,68 @@ { inputs, config, pkgs, ... }: { + # compositor: niri + # bar: waybar + # application launcher: rofi + # idle daemon: hypridle + # screen locker: hyprlock + # wallpaper daemon: wpaperd + # notification daemon: mako + # screenshot tool: flameshot + + imports = [ inputs.niri.nixosModules.niri ]; nixpkgs.overlays = [ inputs.niri.overlays.niri ]; - programs = { - niri.enable = true; - waybar.enable = true; - }; + programs.niri.enable = true; environment.systemPackages = with pkgs; [ - mako # notif daemon, may replace - swaybg # wayland compositor wallpaper program + wpaperd # wallpaper daemon (higher memory usage than average, could replace) xwayland-satellite # necessary for xwayland on niri (flameshot.override { enableWlrSupport = true; }) # screenshot program ]; home-manager.users.wo2w = { + xdg.configFile."wpaperd/config.toml".text = '' + [default] + duration = "2h" + mode = "stretch" + path = "/home/wo2w/Pictures/Wallpapers" + initial-transition = false + ''; + programs = { niri = { settings = { + hotkey-overlay.skip-at-startup = true; + prefer-no-csd = true; + + environment.DISPLAY = ":0"; + + screenshot-path = "~/Pictures/Screenshots/%F_%H-%M-%S"; + + outputs = { + "Sharp Corporation 0x148D Unknown".scale = 2.25; # Laptop builtin screen + }; + binds = { # custom binds "Mod+Space".action.spawn = [ "rofi" "-show" "drun" ]; - "Print".action.spawn = [ "sh" "-c" "QT_QPA_PLATFORM=xcb" "DISPLAY=:0" "flameshot" "screen" ]; - "Shift+Print".action.spawn = [ "sh" "-c" "QT_QPA_PLATFORM=xcb" "DISPLAY=:0" "flameshot" "gui" ]; + "Print".action.screenshot-screen = {}; + "Shift+Print".action.screenshot = {}; + "Alt+Print".action.screenshot-window = {}; "Mod+Print".action.spawn = [ "sh" "-c" "QT_QPA_PLATFORM=xcb" "DISPLAY=:0" "flameshot" "full" ]; + "Mod+T".action.spawn = "kitty"; + + "Super+Alt+L".action.spawn = "hyprlock"; + "Super+Alt+S".action.spawn = [ "systemctl" "sleep" ]; + "Super+Alt+E".action.quit.skip-confirmation = true; + "Super+Alt+Shift+S".action.spawn = "poweroff"; + "Super+Alt+Shift+R".action.spawn = "reboot"; + + "Mod+O".action.open-overview = {}; + "Mod+V".action.toggle-window-floating = {}; + "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = {}; # default binds @@ -34,10 +71,6 @@ # shows a list of important hotkeys. "Mod+Shift+Slash".action.show-hotkey-overlay = {}; - # Suggested binds for running programs: terminal, app launcher, screen locker. - "Mod+T".action.spawn = "kitty"; - "Super+Alt+L".action.spawn = "swaylock"; - # You can also use a shell. Do this if you need pipes, multiple commands, etc. # Note: the entire command goes as a single argument in the end. # Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } @@ -245,9 +278,6 @@ "Ctrl+Print".action.screenshot-screen = {}; "Alt+Print".action.screenshot-window = {}; - # The quit action will show a confirmation dialog to avoid accidental exits. - "Mod+Shift+E".action.quit = {}; - # Powers off the monitors. To turn them back on, do any input like # moving the mouse or pressing any other key. "Mod+Shift+P".action.power-off-monitors = {}; @@ -255,34 +285,94 @@ spawn-at-startup = [ { command = [ "xwayland-satellite" ]; } + { command = [ "wpaperd" "-d" ]; } ]; + workspaces = { + "01-DP-1-misc" = { + name = "Miscellaneous"; + open-on-output = "DP-1"; + }; + "02-DP-1-game" = { + name = "Gaming"; + open-on-output = "DP-1"; + }; + "03-DP-2-fullscreen" = { + name = "Fullscreen"; + open-on-output = "DP-2"; + }; + "04-DP-2-misc" = { + name = "Miscellaneous 2"; + open-on-output = "DP-2"; + }; + }; + window-rules = [ { matches = [{ title = "^Bitwarden$"; }]; - block-out-from = "screencast"; + block-out-from = "screen-capture"; } { - matches = [{ title = "PolicyKit1 KDE Agent$"; }]; - block-out-from = "screencast"; + matches = [{ app-id = "^org.kde.polkit-kde-authentication-agent-1$"; }]; + block-out-from = "screen-capture"; open-floating = true; } # put steam notifications in the bottom right { - matches = [{ - app-id = "steam"; - title = "^notificationtoasts_\d+_desktop$"; - }]; + matches = [ + { app-id = "steam"; } + { title = "^notificationtoasts_\d+_desktop$"; } + ]; default-floating-position = { x = 10; y = 10; relative-to = "bottom-right"; }; } + # Gaming (DP-1) + { + matches = [ + { app-id = "steam"; } + { title = "^Steam$"; } + ]; + open-on-workspace = "Gaming"; + } + { + matches = [{ app-id = "heroic"; }]; + open-on-workspace = "Gaming"; + } + { + matches = [{ app-id = "org.prismlauncher.PrismLauncher"; }]; + open-on-workspace = "Gaming"; + } + { + matches = [{ app-id = "vesktop"; }]; + open-on-workspace = "Gaming"; + } + # Text Editing + # Fullscreen (DP-2) + { + matches = [{ app-id = "librewolf"; }]; + open-on-workspace = "Fullscreen"; + } + { + matches = [{ app-id = "spotify"; }]; + open-on-workspace = "Fullscreen"; + } + # Miscellaneous 2 (DP-2) + { + matches = [{ app-id = "com.dec05eba.gpu_screen_recorder"; }]; + open-on-workspace = "Miscellaneous 2"; + } ]; }; }; + waybar = { + enable = true; + systemd.enable = true; + }; + rofi = { enable = true; package = pkgs.rofi-wayland; @@ -294,26 +384,46 @@ hyprlock = { enable = true; settings = { - # stop hm complaining about the default config conflicting with custom config (bug?) + general.grace = 5; + background = { path = "/home/wo2w/Pictures/uni1.jpg"; blur_passes = 3; - color = "rgb(1a1b26)"; }; - label = { - text = "$DESC"; - }; + label = [ + { + valign = "top"; + position = "0, -400"; + font_size = 128; + text = "$TIME"; + } + { + position = "0, 180"; + font_size = 64; + text = "$DESC"; + } + ]; input-field = { - size = "200, 50"; position = "0, -80"; + size = "400, 100"; }; }; }; }; services = { + # notif daemon + mako = { + enable = true; + settings = { + max-history = 10; + default-timeout = 5000; + anchor = "bottom-right"; + }; + }; + hypridle = { enable = true; settings = { diff --git a/modules/common/stylix.nix b/modules/common/stylix.nix index 0667040..3c57a9b 100755 --- a/modules/common/stylix.nix +++ b/modules/common/stylix.nix @@ -10,17 +10,29 @@ fontconfig.enable = false; font-packages.enable = false; }; - fonts.sizes = { - applications = 12; - desktop = 10; - popups = 10; - terminal = 12; + fonts = { + sizes = { + applications = 12; + desktop = 10; + popups = 10; + terminal = 12; + }; + + monospace = { + package = pkgs.nerd-fonts.hack; + name = "Hack Nerd Font"; + }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; }; }; home-manager.users.wo2w.stylix = { enable = true; targets = { + btop.enable = false; spicetify.enable = false; vesktop.enable = false; vscode.enable = false; diff --git a/modules/home/btop.nix b/modules/home/btop.nix new file mode 100644 index 0000000..c546226 --- /dev/null +++ b/modules/home/btop.nix @@ -0,0 +1,11 @@ +{ config, ... }: + +{ + programs.btop = { + enable = true; + settings = { + color_theme = "tokyo-night"; + update_ms = 500; + }; + }; +} \ No newline at end of file diff --git a/modules/home/default.nix b/modules/home/default.nix index d5d0506..89afc93 100755 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./btop.nix ./bash.nix ./git.nix ./kitty.nix diff --git a/modules/nixos/ssh.nix b/modules/nixos/ssh.nix index aea6b6e..2cf7c2c 100755 --- a/modules/nixos/ssh.nix +++ b/modules/nixos/ssh.nix @@ -11,10 +11,10 @@ Hostname 192.168.2.221 Port 22 Host Swordsmachine - Hostname 192.168.2.122 + Hostname 192.168.2.84 Port 8743 Host Earthmover - Hostname 192.168.2.147 + Hostname 192.168.2.87 Port 8743 "; };