From a92792195a6dc2d795015a8348a4d0d9888b631b Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Thu, 26 Feb 2026 11:03:05 +0100 Subject: [PATCH] Added first part of Hyprland config + added some utilities like blueman, brightnessctl, etc. --- flake.nix | 1 - hosts/laptop/configuration.nix | 24 +++++- hosts/laptop/home.nix | 2 + modules/home-manager/hyprland.nix | 138 +++++++++++++++++++++++++++++- modules/home-manager/rofi.nix | 7 ++ modules/home-manager/wlogout.nix | 7 ++ 6 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 modules/home-manager/rofi.nix create mode 100644 modules/home-manager/wlogout.nix diff --git a/flake.nix b/flake.nix index ef545a8..f0b2e68 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,6 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; - home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 88907eb..1dfdeec 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -38,10 +38,22 @@ programs.zsh.enable = true; # Enable the GNOME Desktop Environment. - services.displayManager.gdm.enable = true; +# services.displayManager.gdm.enable = true; services.desktopManager.gnome.enable = true; # enable hyprland WM -programs.hyprland.enable = true; +programs.hyprland = { + enable = true; + withUWSM = true; + xwayland.enable = true; +}; + +#enable sddm +services.displayManager.sddm = { + enable = true; + wayland.enable = true; +}; + +services.upower.enable = true; # Configure keymap in X11 services.xserver.xkb = { @@ -115,6 +127,14 @@ programs.hyprland.enable = true; wget tree # shows dir in tree zsh # better bash + brightnessctl # control brightness + pulseaudio # sound server + playerctl # controls media player + blueman # GTK-based Bluetooth Manager + udiskie # removable disk automounter for udisks + networkmanagerapplet # NetworkManager control applet + cliphist # Wayland clipboard manager + wl-clipboard # cli copy/past utilities for Wayland ]; # fonts diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 3899358..5128c00 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -11,6 +11,8 @@ imports = [ ../../modules/home-manager/ssh.nix ../../modules/home-manager/fastfetch.nix ../../modules/home-manager/hyprland.nix +../../modules/home-manager/wlogout.nix # logout utility +../../modules/home-manager/rofi.nix # launcher and keybindings helper ]; diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 3dfaa93..dbc0286 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -1,9 +1,145 @@ { config, pkgs, ... }: { + + #refer to https://wiki.hypr.land/Nix/Hyprland-on-Home-Manager/ wayland.windowManager.hyprland.enable = true; #hint Electron apps to use on wayland; - home.sessionVariables.NIXOS_OZONE_WL="1" + home.sessionVariables.NIXOS_OZONE_WL="1"; + + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + "$term" = "kitty"; + "$editor" = "nvim"; + "$file" = "nautilius"; + "$browser" = "firefox" # change to librewolf later +# ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█ +# █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█ + +# █▀▀ █▄░█ █░█ +# ██▄ █░▀█ ▀▄▀ + + # See https://wiki.hyprland.org/Configuring/Environment-variables/ + env = [ + "PATH, $PATH:$scrPath" + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "QT_QPA_PLATFORM,wayland;xcb" + "QT_QPAPLATFORMTHEME,qt6ct" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "MOZ_ENABLE_WAYLAND,1" + "GDK_SCALE,1" + ]; + +# █ █▄░█ █▀█ █░█ ▀█▀ +# █ █░▀█ █▀▀ █▄█ ░█░ + +# is it needed? Doesnt nixos already handles that? + +# █▄▀ █▀▀ █▄█ █▄▄ █ █▄░█ █▀▄ █ █▄░█ █▀▀ █▀ +# █░█ ██▄ ░█░ █▄█ █ █░▀█ █▄▀ █ █░▀█ █▄█ ▄█ + #not all binds now. Do it later when all scripts and etc. are moved + bind = [ + #hyprland/utility keybindings + "$mod, W, togglefloating" + "$mod, G, togglegroup" + "Alt, Return, fullscreen" + "$mod, Left, movefocus, l" + "$mod, Right, movefocus, r" + "$mod, Up, movefocus, u" + "$mod, Down, movefocus, d" + "Alt, Tab, movefocus, 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+Ctrl, Right, workspace, r+1" + "$mod+Ctrl, Left, workspace, r-1" + "$mod+Ctrl, Doown, workspace, empty" + "$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+Ctrl+Alt, Right, movetoworkspace, r+1" + "$mod+Ctrl+Alt, Left, movetoworkspacem r-1" + "$mod, Backspace, exec, wlogout -b 5 -T 600 -B 600" + "$mod+Shift+Ctrl, Left, movewindow, l" + "$mod+Shift+Ctrl, Right, movewindow, r" + "$mod+Shift+Ctrl, Up, movewindow, u" + "$mod+Shift+Ctrl, Down, movewindow, d" + "$mod, mouse_down, workspace, e+1" + "$mod, mouse_up, workspace, e-1" + #apps keybindings + "$mod, T, exec, $term" + "$mod, E, exec, $file" + "$mod, F, exec, $browser" + "$mod+Shift, A, exec, rofi -show drun" + + #plugins keybindings + + ]; + binde = [ + "$mod+Shift, Right, resizeactive, 30 0" + "$mod+Shift, Left, resizeactive, -30, 0" + "$mod+Shift, Up, resizeactive, 0 -30" + "$mod+Shift, Down, resizeactive,m 0 30" + ]; + bindl = [ + ", F1, exec, pactl set-sink-mute @DEFAULT_SINK@ togge" #toggle audio mute + ", F5, exec, playerctl play-pause" # media F4-F6 + ", F4, exec, playerctl previous" + ", F6, exec, playerctl next" + ]; + bindel = [ + ", F2, exec, pactl set-sink-volume @DEFAULT_SINK@ -10%" # decrease volume + ", F3, exec, pactl set-sinl-volume @DEFAULT_SINK@ +10%" # increase volume + ", F7, exec, brightnessctl s 10%-" # decrease brightness + ", F8, exec, brightnessctl s +10%" # increase brightness + ]; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod, Z, movewindow" + "$mod, X, resizewindow" + ]; +# █░░ ▄▀█ █░█ █▄░█ █▀▀ █░█ +# █▄▄ █▀█ █▄█ █░▀█ █▄▄ █▀█ + exec-once = [ + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH + "dbus-update-activation-environment --systemd --all" # for XDPH + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # for XDPH + "systemctl --user start xdg-desktop-portal-wlr.service" + "blueman-applet" # systray app for Bluetooth + "udiskie --no-automount --smart-tray" # front-end that allows to manage removable media + "nm-applet --indicator" # systray app for Network/wifi + "wl-paste --type text --watch cliphist store" # clipboard store text data + "wl-paste --type image --watch cliphist store" # clipboard store image data + ]; +# █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀ +# █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█ + +# █▀▄▀█ █ █▀ █▀▀ +# █░▀░█ █ ▄█ █▄▄ + +# █▀▄▀█ █▀█ █▄░█ █ ▀█▀ █▀█ █▀█ +# █░▀░█ █▄█ █░▀█ █ ░█░ █▄█ █▀▄ + monitor = [ + ",preferred, auto, auto" + ]; + }; } diff --git a/modules/home-manager/rofi.nix b/modules/home-manager/rofi.nix new file mode 100644 index 0000000..4cc954d --- /dev/null +++ b/modules/home-manager/rofi.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + programs.rofi = { + enable = true; +}; +} diff --git a/modules/home-manager/wlogout.nix b/modules/home-manager/wlogout.nix new file mode 100644 index 0000000..fe67914 --- /dev/null +++ b/modules/home-manager/wlogout.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + programs.wlogout = { + enable = true; +}; +}