From f53a991884d061855b35bfdfd4cd47220f9f2149 Mon Sep 17 00:00:00 2001 From: Jack Mechem Date: Fri, 5 Dec 2025 13:02:47 -0800 Subject: [PATCH] Desktop config updates Programs Added (off the top of my head): - spotify - printer stuff Files Added: - print.nix Important Changes: - Lowered linux kernel version on desktop to 6.6 as the upstream kernel was causing the system to restart spontaneously - most likely a bug with Gigabyte Z790 UD boards. The t480 config still uses the upstream kernel. --- flake.lock | 18 +- hosts/desktop/configuration.nix | 8 +- hosts/desktop/hardware-configuration.nix | 33 +++ hosts/desktop/home.nix | 2 +- modules/home-manager/homepackages.nix | 3 + modules/home-manager/hyprland-desktop.nix | 263 ++++++++++++++++++++++ modules/home-manager/shell-aliases.nix | 5 +- modules/nixos/print.nix | 20 ++ 8 files changed, 335 insertions(+), 17 deletions(-) create mode 100644 hosts/desktop/hardware-configuration.nix create mode 100644 modules/home-manager/hyprland-desktop.nix create mode 100644 modules/nixos/print.nix diff --git a/flake.lock b/flake.lock index bd321bd..027e9c3 100755 --- a/flake.lock +++ b/flake.lock @@ -81,11 +81,11 @@ ] }, "locked": { - "lastModified": 1763748372, - "narHash": "sha256-AUc78Qv3sWir0hvbmfXoZ7Jzq9VVL97l+sP9Jgms+JU=", + "lastModified": 1764544324, + "narHash": "sha256-GVBGjO7UsmzLrlOJV8NlKSxukHaHencrJqWkCA6FkqI=", "owner": "nix-community", "repo": "home-manager", - "rev": "d10a9b16b2a3ee28433f3d1c603f4e9f1fecb8e1", + "rev": "e4e25a8c310fa45f2a8339c7972dc43d2845a612", "type": "github" }, "original": { @@ -149,11 +149,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1763421233, - "narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=", + "lastModified": 1764517877, + "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648", + "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c", "type": "github" }, "original": { @@ -210,11 +210,11 @@ ] }, "locked": { - "lastModified": 1763780714, - "narHash": "sha256-n2T7r5HkxofkT3mIbb2bNkzacBdhP/bVeph/yGNnBek=", + "lastModified": 1764534155, + "narHash": "sha256-HQyLJT0ikblWDR/8pzDJ7WYEZoFzkUrgwZk/f+JULBI=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "ef951ed2d976bcd1f57a09f358fdda9fa9425018", + "rev": "fb066e133e614c024a470608ff56585c4f707b44", "type": "github" }, "original": { diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index d4f9308..c354b32 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -16,12 +16,13 @@ ../../modules/nixos/system-packages.nix ../../modules/nixos/user-jack.nix ../../modules/nixos/sound.nix + ../../modules/nixos/print.nix ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_6; networking.hostName = "jackdesk"; networking.networkmanager.enable = true; @@ -33,9 +34,6 @@ time.timeZone = "America/Los_Angeles"; - # Enable CUPS to print documents. - services.printing.enable = true; - services.dbus.enable = true; programs.zsh.enable = true; @@ -67,6 +65,6 @@ services.openssh.enable = true; - system.stateVersion = "25.05"; + system.stateVersion = "25.11"; } diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix new file mode 100644 index 0000000..e73ffb8 --- /dev/null +++ b/hosts/desktop/hardware-configuration.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/eaa4055f-0ae6-4fd3-877b-b3851ef35c11"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/30B4-F0D7"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/ea12ddc1-5a90-4956-bc87-ac069efd4fe0"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 8257d12..ce99c37 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -11,7 +11,7 @@ inputs.zen-browser.homeModules.twilight ../../modules/home-manager/zsh.nix ../../modules/home-manager/tmux.nix - ../../modules/home-manager/hyprland.nix + ../../modules/home-manager/hyprland-desktop.nix ../../modules/home-manager/homepackages.nix ../../modules/home-manager/shell-aliases.nix ]; diff --git a/modules/home-manager/homepackages.nix b/modules/home-manager/homepackages.nix index 9fe031f..0179d05 100644 --- a/modules/home-manager/homepackages.nix +++ b/modules/home-manager/homepackages.nix @@ -13,5 +13,8 @@ lunar-client discord + + spotify + pavucontrol ]; } diff --git a/modules/home-manager/hyprland-desktop.nix b/modules/home-manager/hyprland-desktop.nix new file mode 100644 index 0000000..c38dabf --- /dev/null +++ b/modules/home-manager/hyprland-desktop.nix @@ -0,0 +1,263 @@ +{ pkgs, ... }: +{ + wayland.windowManager.hyprland = { + enable = true; + extraConfig = '' + +$monitor1 = DP-1 +$monitor2 = DP-2 +$monitor3 = HDMI-A-1 + +# Configure Monitors +monitor=$monitor1,2560x1440@144,0x0,1,bitdepth,10 +monitor=$monitor2,1920x1080@75,2560x0,1,bitdepth,10 +monitor=HDMI-A-1,1920x1080@60,-2560x0,1,bitdepth,10 + +# Workspaces +workspace=1,monitor:$monitor1,default:true +workspace=2,monitor:$monitor1 +workspace=3,monitor:$monitor1 +workspace=4,monitor:$monitor1 +workspace=5,monitor:$monitor1 +workspace=6,monitor:$monitor2,default:true +workspace=7,monitor:$monitor2 +workspace=8,monitor:$monitor2 +workspace=9,monitor:$monitor2 +workspace=10,monitor:$monitor2 +workspace=11,monitor:$monitor3,default:true +workspace=12,monitor:$monitor3 + + + +# Start Shit +#exec-once = sh /home/jack/.config/waybar/launch-waybar.sh & waypaper --restore +exec-once = waypaper --restore +exec-once = gtkbar +exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once=solaar -w hide +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Set programs that you use +$terminal = ghostty +$fileManager = thunar +#$menu = XDG_DATA_DIRS="/usr/share:/usr/local/share:/var/lib/flatpak/exports/share:/home/jack/.local/share/flatpak/exports/share" wofi --show drun +$menu = gtkapps + +# Some default env vars. +env = XCURSOR_SIZE,24 +env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + accel_profile = flat + + sensitivity = 0 # -1.0 to 1.0, 0 means no modification. +} + +general { + gaps_in = 3 + gaps_out = 10,10,10,10 + border_size = 2 + col.active_border = rgba(e4687690) + col.inactive_border = rgba(2c2b3180) + + # Every other layout is bad + layout = dwindle + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on (Why tf would you turn this on) + allow_tearing = false +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 12 + + blur { + enabled = true + new_optimizations = true + size = 8 + passes = 2 + } + + shadow { + enabled = true + range = 20 + render_power = 5 + color = rgba(00000040) + } + + layerrule = blur,notifications + layerrule = ignorezero,notifications + layerrule = blur,gtk4-layer-shell + layerrule = ignorealpha 0.3,gtk4-layer-shell + layerrule = blur,gtkapps +} + +animations { + enabled = false + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1 + + animation = windows, 1, 3, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +# master { +# # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more +# new_is_master = true +# } + + +misc { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers +} + + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. +windowrulev2 = float,class:^(pavucontrol)$ +windowrulev2 = float,class:^(nwg-look)$ +windowrulev2 = float,class:^(waypaper)$ +windowrulev2 = float,class:^(openrgb)$ +windowrulev2 = float,class:^(solaar)$ +windowrulev2 = float,class:^(rice-settings)$ + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Rice Settings (Developed by me) +bind = SUPER, grave, exec, rice-settings + + +# Multimedia Keys +bindle = , XF86AudioRaiseVolume, exec, pamixer -i 2 +bindle = , XF86AudioLowerVolume, exec, pamixer -d 2 +bindl = , XF86AudioMute, exec, pamixer -t +bindl = , XF86AudioMicMute, exec, pamixer --default-source -t +bind = , XF86AudioPrev, exec, playerctl previous +bind = , XF86AudioPlay, exec, playerctl play-pause +bind = , XF86AudioPause, exec, playerctl pause +bind = , XF86AudioNext, exec, playerctl next + +bind = $mainMod, RETURN, exec, $terminal +bind = $mainMod SHIFT, RETURN, exec, [float] $terminal +bind = $mainMod, Q, killactive, +bind = $mainMod SHIFT, M, exit, +bind = $mainMod, E, exec, $fileManager +bind = $mainMod SHIFT, E, exec, [float] $fileManager +bind = $mainMod, W, exec, zen-browser +bind = $mainMod, TAB, togglefloating, +bind = $mainMod, SPACE, exec, $menu +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, V, togglesplit, # dwindle +bind = $mainMod, M, fullscreen, 1 +bind = $mainMod, F, fullscreen, 0 + +# Hide Bar +bind = $mainMod SHIFT, P, exec, killall ags || exec ags + +# screenshot +bind = $mainMod SHIFT, S, exec, grimshot savecopy area + +# emojis +bind = $mainMod, HOME, exec, wofi-emoji + + +# Window focus +bind = SUPER, h, movefocus, l +bind = SUPER, l, movefocus, r +bind = SUPER, k, movefocus, u +bind = SUPER, j, movefocus, d + +# Move window +bind = SUPER SHIFT, h, movewindow, l +bind = SUPER SHIFT, l, movewindow, r +bind = SUPER SHIFT, k, movewindow, u +bind = SUPER SHIFT, j, movewindow, d + +# Resize window +bind = SUPER ALT, h, resizeactive, -160 0 +bind = SUPER ALT, l, resizeactive, 160 0 +bind = SUPER ALT, k, resizeactive, 0 -160 +bind = SUPER ALT, j, resizeactive, 0 160 + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 +bind = $mainMod ALT, 1, workspace, 11 +bind = $mainMod ALT, 2, workspace, 12 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 +bind = $mainMod ALT SHIFT, 1, movetoworkspace, 11 +bind = $mainMod ALT SHIFT, 2, movetoworkspace, 12 + +# Example special workspace (scratchpad) +bind = $mainMod, O, togglespecialworkspace, magic +bind = $mainMod SHIFT, O, movetoworkspace, special:magic + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Toggle bar +bind = $mainMod,b,exec,bash -c 'pgrep gtkbar &>/dev/null && killall gtkbar || gtkbar &' + +# Toggle extra monitor +bind = $mainMod, minus, exec, ~/.config/hypr/togglemonitor.sh $monitor3 + ''; + }; +} diff --git a/modules/home-manager/shell-aliases.nix b/modules/home-manager/shell-aliases.nix index 90703fd..e2d45ec 100644 --- a/modules/home-manager/shell-aliases.nix +++ b/modules/home-manager/shell-aliases.nix @@ -7,11 +7,12 @@ { home.shellAliases = { - nixreb = "sudo nixos-rebuild switch --flake /home/jack/nixos/#t480"; + nixrebt = "sudo nixos-rebuild switch --flake /home/jack/nixos/#t480"; + nixrebd = "sudo nixos-rebuild switch --flake /home/jack/nixos/#desktop"; v = "nvim"; c = "clear"; cl = "clear && ls"; nixconf = "nvim ~/nixos/"; - a = ''echo -e " a -> List aliases nixreb -> Rebuild nixos config\n nixconf -> Open nixos config\n v -> nvim\n c -> clear\n cl -> clear && ls"''; + a = ''echo -e " a -> List aliases\n nixreb[t,d] -> Rebuild nixos config [t for #t480, d for #dektop]\n nixconf -> Open nixos config\n v -> nvim\n c -> clear\n cl -> clear && ls"''; }; } diff --git a/modules/nixos/print.nix b/modules/nixos/print.nix new file mode 100644 index 0000000..2f6cbab --- /dev/null +++ b/modules/nixos/print.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + + services.printing.enable = true; + + services.printing.browsing = true; + services.printing.browsedConf = '' + BrowseDNSSDSubTypes _cups,_print + BrowseLocalProtocols all + BrowseRemoteProtocols all + CreateIPPPrinterQueues All + + BrowseProtocols all + ''; + services.avahi = { + enable = true; + nssmdns = true; + }; + +}