nixos/nixos/modules/xserver.nix
2026-03-12 14:51:01 +01:00

54 lines
1.1 KiB
Nix

{
config,
pkgs,
...
}: {
services.xserver.enable = false;
services.xserver.videoDrivers = ["nvidia"];
hardware.graphics = {
enable = true;
enable32Bit = true;
};
hardware.nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
open = false; # closed-source driver
prime = {
offload.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "${pkgs.sway}/bin/sway --unsupported-gpu";
user = "elisiei";
};
default_session = initial_session;
};
};
console.keyMap = "es";
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
};
};
#environment.etc."xdg/sessions/hyprland.desktop".text = ''
# [Desktop Entry]
# Name=Hyprland
# Comment=Hyprland Wayland Compositor
# Exec=Hyprland
# Type=Application
#'';
}