feat(hyprland): add hyprland to nixos modules and set relevant nvidia settings

This commit is contained in:
Mohammad Rafiq 2025-05-18 16:59:51 +08:00
parent 1bf0680ac4
commit 8ff864caed
No known key found for this signature in database
5 changed files with 33 additions and 0 deletions

View file

@ -13,6 +13,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
neovim neovim
ripgrep ripgrep
kitty
]; ];
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";

View file

@ -0,0 +1,10 @@
{ config, lib, ... }:
{
imports = [
./windowManager.nix
];
options.desktop = {
windowManager = lib.pantheon.mkStrOption;
};
}

View file

@ -0,0 +1,15 @@
{ config, lib, ... }:
{
config = lib.mkMerge [
(lib.mkIf (config.desktop.windowManager == "hyprland") {
environment.variables = {
ELECTRON_OZONE_PLATFORM_HINT = "auto";
NIXOS_OZONE_WL = "1";
};
programs.hyprland = {
enable = true;
withUWSM = true;
};
})
];
}

View file

@ -11,6 +11,11 @@
hardware.nvidia.open = true; hardware.nvidia.open = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest; hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
environment.variables = {
LIBVA_DRIVER_NAME = "nvidia";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
NVD_BACKEND = "direct";
};
} }
]); ]);
} }

View file

@ -11,6 +11,8 @@
hardware.platform = "amd"; hardware.platform = "amd";
hardware.gpu = "nvidia"; hardware.gpu = "nvidia";
desktop.windowManager = "hyprland";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }