feat: add hyprland nvidia configuration for desktop

This commit is contained in:
ooks-io 2024-02-12 11:57:43 +13:00
parent 94a096bb6d
commit bb41c51344
5 changed files with 20 additions and 1 deletions

View file

@ -8,6 +8,11 @@
options.homeModules.desktop.wayland.windowManager = {
hyprland = {
enable = lib.mkEnableOption "Enable Hyprland window-manager";
nvidia = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Apply Hyprland nvidia settings";
};
};
};

View file

@ -1,6 +1,7 @@
{ config, lib, ... }:
let
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
pointer = config.home.pointerCursor;
in
{
config = lib.mkIf cfg.enable {
@ -20,6 +21,10 @@ in
};
dwindle.split_width_multiplier = 1.35;
exec-once = [
"hyprctl setcursor ${pointer.name} ${toString pointer.size}"
];
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;

View file

@ -92,7 +92,7 @@ in
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
"SUPERSHIFT ALT, delete, exit"
"SUPERSHIFT ALT, delete, exec, pkill Hyprland"
"SUPER, F, fullscreen"
"SUPER, Space, togglefloating"
"SUPER, P, pseudo" # dwindle

View file

@ -47,6 +47,14 @@ in
force_default_wallpaper = 0;
};
env = lib.mkIf cfg.nvidia [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
"__GLX_VENDEOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
];
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;

View file

@ -15,6 +15,7 @@
indentBlankline = true;
};
};
homeModules.desktop.wayland.windowManager.hyprland.nvidia = true;
monitors = [{
name = "DP-1";