diff --git a/home-manager/hyprland/settings.nix b/home-manager/hyprland/settings.nix index 3312aab..05893c0 100644 --- a/home-manager/hyprland/settings.nix +++ b/home-manager/hyprland/settings.nix @@ -13,16 +13,15 @@ in # Autostart exec-once = [ - "${app.browser}" - "${app.terminal}" + app.browser + app.terminal "hypridle" "systemctl --user start hyprpolkitagent" - # "waybar" "waypaper --restore" ]; env = [ - "ELECTRON_OZONE_PLATFORM_HINT,auto" + "ELECTRON_OZONE_PLATFORM_HINT,auto" # Tell Electron apps to use Wayland ]; general = { diff --git a/modules/hardware/graphics/default.nix b/modules/hardware/graphics/default.nix index 2712b6f..c2d26e4 100644 --- a/modules/hardware/graphics/default.nix +++ b/modules/hardware/graphics/default.nix @@ -1,19 +1,8 @@ -{ pkgs, ... }: - { imports = [ ./nvidia.nix ]; - # For hardware acceleration - environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD"; - # Enable OpenGL - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - # Used for hardware-acceleration - intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD - ]; - }; + hardware.graphics.enable = true; } diff --git a/modules/hardware/graphics/nvidia.nix b/modules/hardware/graphics/nvidia.nix index bb5c7e9..6b33ac2 100644 --- a/modules/hardware/graphics/nvidia.nix +++ b/modules/hardware/graphics/nvidia.nix @@ -1,11 +1,26 @@ +{ pkgs, ... }: + { - hardware.nvidia = { - # Required - modesetting.enable = true; - # Use closed-source drivers - open = false; - # Enable the Nvidia settings menu - nvidiaSettings = true; + boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; + + # For hardware acceleration + environment.sessionVariables.LIBVA_DRIVER_NAME = "nvidia"; + + hardware = { + graphics.extraPackages = with pkgs; [ + # Used for hardware-acceleration + nvidia-vaapi-driver + ]; + nvidia = { + # Required + modesetting.enable = true; + # Use closed-source drivers + open = false; + # Enable the Nvidia settings menu + nvidiaSettings = true; + # Enable nvidia-suspend.service, nvidia-hibernate.service and nvidia-resume.service + powerManagement.enable = true; + }; }; # Load Nvidia driver for Xorg and Wayland