From 9913fbbe27b6b4ac3bd57e7b30b0b9f7b268f814 Mon Sep 17 00:00:00 2001 From: rogueking Date: Mon, 11 Aug 2025 01:01:41 -0700 Subject: [PATCH] fixed ghostty and added base-experimental hyprland --- home-manager/commands/cli-tools.nix.disable | 132 ---------- home-manager/commands/commands.nix | 2 +- home-manager/commands/ghostty.nix | 36 --- home-manager/programs/ghostty/ghostty.nix | 6 + home-manager/programs/hypr/hypridle.nix | 38 +++ home-manager/programs/hypr/hyprland.nix | 164 ++++++++++++ home-manager/programs/hypr/hyprlock.nix | 48 ++++ home-manager/programs/hypr/waybar.nix | 275 ++++++++++++++++++++ home-manager/programs/programs.nix | 17 +- hosts/eva-01/configuration.nix | 25 ++ 10 files changed, 564 insertions(+), 179 deletions(-) delete mode 100644 home-manager/commands/cli-tools.nix.disable delete mode 100644 home-manager/commands/ghostty.nix create mode 100644 home-manager/programs/hypr/hypridle.nix create mode 100644 home-manager/programs/hypr/hyprland.nix create mode 100644 home-manager/programs/hypr/hyprlock.nix create mode 100644 home-manager/programs/hypr/waybar.nix diff --git a/home-manager/commands/cli-tools.nix.disable b/home-manager/commands/cli-tools.nix.disable deleted file mode 100644 index 24ca749..0000000 --- a/home-manager/commands/cli-tools.nix.disable +++ /dev/null @@ -1,132 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - agenix - bat - btop - dig - git-filter-repo - openconnect - parted - putty - thc-hydra - tldr - traceroute - trivy - wget - ]; -#++ (with pkgs-unstable; [ -# vllm -# ]); - - - programs = { - fastfetch.enable = true; - fzf.enable = true; - bat.enable = true; - btop.enable = true; - kitty.enable = true; - yazi.enable = true; - starship.enable = true; - lazygit.enable = true; - thefuck.enable = true; - thefuck.enableZshIntegration = true; - - git = { - enable = true; - userName = "rogueking"; - userEmail = "miguel@muniz.org"; - lfs.enable = true; - signing = { - signByDefault = true; - gpgPath = "/opt/1Password/op-ssh-sign"; - key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHI7zcxrwwg4VqpGduhPX31aslzXwkRXiM32+8K+aIMu"; - }; - extraConfig = { - gpg = { - format = "ssh"; - }; - - }; - - }; - - eza = { - enable = true; - icons = "auto"; - enableZshIntegration = true; - extraOptions = [ - "--group-directories-first" - ]; - }; - - ssh = { - enable = true; - matchBlocks = { - global = { - host = "*"; - setEnv = { - TERM = "xterm-256color"; - }; - }; - }; - extraConfig = '' - IdentityAgent ~/.1password/agent.sock - ''; - }; - - zoxide = { - enable = true; - enableZshIntegration = true; - }; - - zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - historySubstringSearch.enable = true; - - shellAliases = { - cd = "z"; - cat = "bat"; - catp = "bat -p"; - fk = "thefuck"; - fu = "thefuck"; - fuck = "thefuck"; - grep = "grep --color=auto"; - lg = "lazygit"; - ll = "eza -la"; - ls = "eza --color=auto"; - lt = "eza --tree"; - open = "xdg-open"; - locate = "sudo plocate"; - tulpn = "sudo netstat -tulpn"; - rebuild = "sudo nixos-rebuild switch --flake /etc/nixos#$(uname -n)"; - }; - - envExtra = '' - eval $(thefuck --alias) - ''; - - profileExtra = '' - export SSH_AUTH_SOCK=~/.1password/agent.sock - ''; - - initExtra = '' - fastfetch - ''; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - }; - - oh-my-zsh = { - enable = true; - }; - }; - - }; -} diff --git a/home-manager/commands/commands.nix b/home-manager/commands/commands.nix index 0d43637..8e760b2 100644 --- a/home-manager/commands/commands.nix +++ b/home-manager/commands/commands.nix @@ -11,7 +11,6 @@ ./eza.nix ./fastfetch/fastfetch.nix ./git.nix - ./ghostty.nix ./newsboat.nix ./nixvim/default.nix ./starship.nix @@ -82,6 +81,7 @@ reaverwps-t6x recon-ng steghide + sqlmap thc-hydra ] diff --git a/home-manager/commands/ghostty.nix b/home-manager/commands/ghostty.nix deleted file mode 100644 index 67fbe8c..0000000 --- a/home-manager/commands/ghostty.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - programs.ghostty = { - enable = true; - enableZshIntegration = true; - settings = { - theme = "Adwaita Dark"; - - #custom-shader = "./shaders/tft.glsl"; - - font-family = "JetBrainsMono Nerd Font"; - font-family-italic = "Maple Mono"; - font-family-bold-italic = "Maple Mono"; - font-size = 12; - bold-is-bright = true; - - window-decoration = false; - background-opacity = 0.8; - #background-blur-radius = 120; - window-save-state = "always"; - - mouse-hide-while-typing = true; - cursor-invert-fg-bg = true; - - keybind = [ - "super+shift+k=new_split:down" - "super+shift+l=new_split:right" - "super+shift+x=close_window" - ]; - }; - }; - #home.file.".config/ghostty/shaders" = { - # enable = true; - # source = ./shaders; - # recursive = true; - #}; -} diff --git a/home-manager/programs/ghostty/ghostty.nix b/home-manager/programs/ghostty/ghostty.nix index 67fbe8c..6ab0a48 100644 --- a/home-manager/programs/ghostty/ghostty.nix +++ b/home-manager/programs/ghostty/ghostty.nix @@ -3,7 +3,13 @@ enable = true; enableZshIntegration = true; settings = { + # Use explicit theme instead of relying on system theme detection theme = "Adwaita Dark"; + + # Explicitly set color scheme preference to avoid GTK warnings + gtk-adwaita = true; + + gtk-single-instance = true; #custom-shader = "./shaders/tft.glsl"; diff --git a/home-manager/programs/hypr/hypridle.nix b/home-manager/programs/hypr/hypridle.nix new file mode 100644 index 0000000..f442a07 --- /dev/null +++ b/home-manager/programs/hypr/hypridle.nix @@ -0,0 +1,38 @@ +{ + services.hypridle = { + enable = true; + settings = { + general = { + lock_cmd = "pidof hyprlock || hyprlock"; + # unlock_cmd = "killall hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + }; + + listeners = [ + { + timeout = 30; + on-timeout = "pidof hyprlock && hyprctl dispatch dpms off"; + on-resume = "pidof hyprlock && hyprctl dispatch dpms on"; + + } + { + timeout = 540; + on-timeout = "notify-send 'You are idle!'"; + on-resume = "notify-send 'Welcome back!'"; + } + { + timeout = 600; + on-timeout = "loginctl lock-session"; + on-resume = "notify-send 'Desktop Unlocked!'"; + } + # { + # timeout = 1200; + # on-timeout = "systemctl suspend"; + # on-resume = "notify-send 'Welcome back to your desktop!'"; + # } + ]; + }; + }; +} diff --git a/home-manager/programs/hypr/hyprland.nix b/home-manager/programs/hypr/hyprland.nix new file mode 100644 index 0000000..47fbf85 --- /dev/null +++ b/home-manager/programs/hypr/hyprland.nix @@ -0,0 +1,164 @@ +{ config, configPath, ... }: +{ + wayland.windowManager.hyprland = { + enable = true; + settings = { + # === Monitor configuration === + monitor = "eDP-1, 1920x1080@60.03300, 0x0, 1.25"; + + # === Autostart / Exec commands === + exec-once = [ + "sleep 1 && nm-applet --indicator" + "waybar" + "ghostty" + "swww-daemon" + "eww daemon" + "swww img ${configPath}/assets/ena/wallpaper.png" + ]; + + # === Input settings === + input = { + kb_layout = "us"; + kb_variant = ""; + kb_model = ""; + kb_options = ""; + kb_rules = ""; + follow_mouse = true; + touchpad = { + natural_scroll = false; + }; + sensitivity = 0; + }; + + # === General settings === + general = { + gaps_in = 2.5; + gaps_out = 5; + border_size = 2; + "col.active_border" = "rgb(cdd6f4)"; + "col.inactive_border" = "rgba(595959aa)"; + layout = "dwindle"; + }; + + misc = { + disable_hyprland_logo = true; + }; + + # === Decoration settings === + decoration = { + rounding = 3; + blur = { + enabled = true; + size = 7; + passes = 3; + }; + }; + + # === Animations === + animations = { + enabled = true; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; + + # === Dwindle layout options === + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + # === Gestures === + gestures = { + workspace_swipe = true; + workspace_swipe_fingers = 3; + workspace_swipe_invert = true; + workspace_swipe_distance = 200; + workspace_swipe_forever = true; + }; + + # === Per-device configuration === + device = [ + { + name = "epic-mouse-v1"; + sensitivity = -0.5; + } + ]; + + # === Window rules (v2) === + windowrulev2 = [ + "opacity 0.8 0.8,class:^(dolphin)$" + ]; + + # === Modifier key === + "$mod" = "SUPER"; + + # === Key bindings === + bind = [ + "$mod, T, exec, ghostty" + "$mod, Q, killactive" + "$mod, L, exec, hyprlock" + "$mod, M, exec, wlogout --protocol layer-shell" + "$mod SHIFT, M, exit" + "$mod, E, exec, dolphin" + "$mod, V, togglefloating" + "$mod, SPACE, exec, rofi -show drun" + "$mod, P, pseudo" + "$mod, J, togglesplit" + "$mod, S, exec, flameshot full" + "$mod SHIFT, S, exec, flameshot gui" + + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + "$mod SHIFT, left, movewindow, l" + "$mod SHIFT, right, movewindow, r" + "$mod SHIFT, up, movewindow, u" + "$mod SHIFT, down, movewindow, d" + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" + + "$mod, mouse_down, workspace, e+1" + "$mod, mouse_up, workspace, e-1" + + "$mod SHIFT, L, resizeactive, 10 0" + "$mod SHIFT, H, resizeactive, -10 0" + "$mod SHIFT, K, resizeactive, 0 -10" + "$mod SHIFT, J, resizeactive, 0 10" + ]; + + # === Mouse bindings === + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + }; + }; +} diff --git a/home-manager/programs/hypr/hyprlock.nix b/home-manager/programs/hypr/hyprlock.nix new file mode 100644 index 0000000..fefbcf6 --- /dev/null +++ b/home-manager/programs/hypr/hyprlock.nix @@ -0,0 +1,48 @@ +{ configPath, ... }: +{ + programs.hyprlock = { + enable = true; + settings = { + general = { + disable_loading_bar = true; + grace = 10; + hide_cursor = true; + no_fade_in = false; + }; + background = [ + { + path = "${configPath}/assets/ena/wallpaper.png"; + blur_passes = 3; + blur_size = 8; + } + ]; + image = [ + { + path = "${configPath}/assets/pfp.jpg"; + size = 150; + border_size = 4; + border_color = "rgb(0C96F9)"; + rounding = -1; + position = "0, 200"; + halign = "center"; + valign = "center"; + } + ]; + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(CFE6F4)"; + inner_color = "rgb(657DC2)"; + outer_color = "rgb(0D0E15)"; + outline_thickness = 5; + placeholder_text = "Password..."; + shadow_passes = 2; + } + ]; + }; + }; +} diff --git a/home-manager/programs/hypr/waybar.nix b/home-manager/programs/hypr/waybar.nix new file mode 100644 index 0000000..df92e48 --- /dev/null +++ b/home-manager/programs/hypr/waybar.nix @@ -0,0 +1,275 @@ +{ + pkgs, + lib, + config, + ... +}: +let + betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; + clock24h = false; +in +with lib; +{ + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; + modules-center = [ "hyprland/workspaces" ]; + modules-left = [ + "custom/startmenu" + "hyprland/window" + "pulseaudio" + "cpu" + "memory" + "idle_inhibitor" + ]; + modules-right = [ + "custom/hyprbindings" + "custom/notification" + "custom/exit" + "battery" + "tray" + "clock" + ]; + + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; + }; + "clock" = { + format = if clock24h == true then '' {:L%H:%M}'' else '' {:L%I:%M %p}''; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; + }; + "hyprland/window" = { + max-length = 22; + separate-outputs = false; + rewrite = { + "" = " 🙈 No Windows? "; + }; + }; + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + }; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + }; + "disk" = { + format = " {free}"; + tooltip = true; + }; + "network" = { + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; + format-ethernet = " {bandwidthDownOctets}"; + format-wifi = "{icon} {signalStrength}%"; + format-disconnected = "󰤮"; + tooltip = false; + }; + "tray" = { + spacing = 12; + }; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ + "" + "" + "" + ]; + }; + on-click = "sleep 0.1 && pavucontrol"; + }; + "custom/exit" = { + tooltip = false; + format = ""; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = ""; + # exec = "rofi -show drun"; + on-click = "sleep 0.1 && rofi-launcher"; + }; + "custom/hyprbindings" = { + tooltip = false; + format = "󱕴"; + on-click = "sleep 0.1 && list-keybinds"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && task-waybar"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + on-click = ""; + tooltip = false; + }; + } + ]; + style = concatStrings [ + '' + * { + font-family: JetBrainsMono Nerd Font Mono; + font-size: 16px; + border-radius: 0px; + border: none; + min-height: 0px; + } + window#waybar { + background: rgba(0,0,0,0); + } + #workspaces { + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base01}; + margin: 4px 4px; + padding: 5px 5px; + border-radius: 16px; + } + #workspaces button { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + opacity: 0.5; + transition: ${betterTransition}; + } + #workspaces button.active { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + transition: ${betterTransition}; + opacity: 1.0; + min-width: 40px; + } + #workspaces button:hover { + font-weight: bold; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + opacity: 0.8; + transition: ${betterTransition}; + } + tooltip { + background: #${config.lib.stylix.colors.base00}; + border: 1px solid #${config.lib.stylix.colors.base08}; + border-radius: 12px; + } + tooltip label { + color: #${config.lib.stylix.colors.base08}; + } + #window, #pulseaudio, #cpu, #memory, #idle_inhibitor { + font-weight: bold; + margin: 4px 0px; + margin-left: 7px; + padding: 0px 18px; + background: #${config.lib.stylix.colors.base04}; + color: #${config.lib.stylix.colors.base00}; + border-radius: 24px 10px 24px 10px; + } + #custom-startmenu { + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base02}; + font-size: 28px; + margin: 0px; + padding: 0px 30px 0px 15px; + border-radius: 0px 0px 40px 0px; + } + #custom-hyprbindings, #network, #battery, + #custom-notification, #tray, #custom-exit { + font-weight: bold; + background: #${config.lib.stylix.colors.base0F}; + color: #${config.lib.stylix.colors.base00}; + margin: 4px 0px; + margin-right: 7px; + border-radius: 10px 24px 10px 24px; + padding: 0px 18px; + } + #clock { + font-weight: bold; + color: #0D0E15; + background: linear-gradient(90deg, #${config.lib.stylix.colors.base0E}, #${config.lib.stylix.colors.base0C}); + margin: 0px; + padding: 0px 15px 0px 30px; + border-radius: 0px 0px 0px 40px; + } + '' + ]; + }; +} diff --git a/home-manager/programs/programs.nix b/home-manager/programs/programs.nix index fed6d41..dd0cf12 100644 --- a/home-manager/programs/programs.nix +++ b/home-manager/programs/programs.nix @@ -4,6 +4,10 @@ imports = [ ./ghostty/ghostty.nix ./rofi/rofi.nix + ./hypr/hypridle.nix + ./hypr/hyprland.nix + ./hypr/hyprlock.nix + #./hypr/waybar.nix ]; home.packages = @@ -54,11 +58,11 @@ vscode wireshark yubikey-agent - ]) + ] ++ lib.optionals (hostname == "eva-01") [ - - ] + sonic-visualiser + ]) ++ lib.optionals (hostname == "eva-03") [ @@ -66,11 +70,4 @@ # environment.sessionVariables.NIXOS_OZONE_WL = "1"; - programs.waybar = { - enable = true; - }; - - programs.wlogout = { - enable = true; - }; } diff --git a/hosts/eva-01/configuration.nix b/hosts/eva-01/configuration.nix index 84570a4..4265d72 100644 --- a/hosts/eva-01/configuration.nix +++ b/hosts/eva-01/configuration.nix @@ -45,6 +45,7 @@ # powertop.enable = true; # }; + # Power Management services.thermald.enable = true; services.power-profiles-daemon.enable = false; services.auto-cpufreq.enable = true; @@ -63,6 +64,13 @@ useStockConfig = true; }; + # Intel CPU integrated graphics packages + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver + intel-ocl + intel-vaapi-driver + ]; + networking.hostName = "eva-01"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -96,6 +104,7 @@ # Enable the X11 windowing system. # You can disable this if you're only using the Wayland session. services.xserver.enable = false; + programs.xwayland.enable = true; # Enable the KDE Plasma Desktop Environment. services.displayManager.sddm.enable = true; @@ -103,6 +112,18 @@ services.desktopManager.plasma6.enable = true; #services.displayManager.sddm.theme = "sddm-astronaut-theme"; + # Enable Hyprland wayland compositor + programs.hyprland.enable = true; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + # Enable XDG Desktop Portal for proper D-Bus integration + services.dbus.enable = true; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + services.tailscale.enable = true; #Enable Ollama daemon @@ -111,6 +132,7 @@ package = pkgs-unstable.ollama; }; + #Enable Hyprland services.fprintd.enable = true; services.fprintd.tod.enable = true; services.fprintd.tod.driver = pkgs.libfprint-2-tod1-goodix; @@ -123,6 +145,8 @@ # Enable CUPS to print documents. services.printing.enable = false; + services.avahi.enable = true; + services.avahi.nssmdns4 = true; # Enable Smart Card services.pcscd.enable = true; @@ -257,6 +281,7 @@ #fonts nerd-fonts.hack + nerd-fonts.fira-code #unstable #pkgs-unstable.vllm