config/modules/nixos/protocols/wayland/default.nix

111 lines
3 KiB
Nix
Raw Normal View History

2024-05-23 20:26:30 +00:00
{
options,
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.custom; let
cfg = config.protocols.wayland;
in {
options.protocols.wayland = with types; {
enable = mkBoolOpt false "Enable Wayland Protocol";
};
config = mkIf cfg.enable {
environment.etc."greetd/environments".text = ''
2024-06-26 16:35:25 -04:00
sway
2024-05-23 20:26:30 +00:00
'';
2025-05-06 20:02:36 -04:00
services.greetd = {
enable = true;
settings = {
default_session = {
command = "niri-session";
user = "zoey";
2024-05-23 20:26:30 +00:00
};
};
};
2025-03-22 16:03:07 -04:00
programs.uwsm = {
2025-04-07 13:07:15 -04:00
waylandCompositors = {
# "mwc" = {
# prettyName = "MWC";
# binPath = "/run/current-system/sw/bin/mwc";
# comment = "previously owl";
# };
# niri = {
# prettyName = "niri";
# binPath = "/run/current-system/sw/bin/niri";
# comment = "niri";
# };
};
2025-03-22 16:03:07 -04:00
};
# environment.systemPackages = [
# pkgs.custom.mwc
# ];
2025-01-09 13:33:20 -05:00
2024-10-17 02:05:02 -04:00
programs.hyprland = {
2025-01-09 13:33:20 -05:00
withUWSM = true;
2025-05-09 18:43:27 -04:00
enable = true;
2025-01-19 15:04:19 -05:00
xwayland.enable = true;
2025-01-12 13:37:57 -05:00
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
2024-10-17 02:05:02 -04:00
};
2025-04-07 13:07:15 -04:00
programs.niri.enable = true;
2025-05-09 18:43:27 -04:00
programs.niri.package = inputs.niri-src.packages.${pkgs.system}.niri;
2025-01-12 13:37:57 -05:00
2024-05-23 20:26:30 +00:00
environment = {
variables = {
2024-08-21 14:35:32 -04:00
NIXOS_OZONE_WL = "1";
2025-01-12 13:37:57 -05:00
# __GL_GSYNC_ALLOWED = "0";
# __GL_VRR_ALLOWED = "0";
2024-05-23 20:26:30 +00:00
_JAVA_AWT_WM_NONEREPARENTING = "1";
SSH_AUTH_SOCK = "/run/user/1000/keyring/ssh";
DISABLE_QT5_COMPAT = "0";
2025-01-12 15:55:22 -05:00
GDK_BACKEND = "wayland";
2024-05-23 20:26:30 +00:00
ANKI_WAYLAND = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
2025-01-12 15:55:22 -05:00
QT_QPA_PLATFORM = "wayland";
2024-05-23 20:26:30 +00:00
DISABLE_QT_COMPAT = "0";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
MOZ_ENABLE_WAYLAND = "1";
WLR_BACKEND = "wayland";
WLR_RENDERER = "wayland";
XDG_SESSION_TYPE = "wayland";
2025-04-07 13:07:15 -04:00
SDL_VIDEODRIVER = "wayland,x11";
XDG_CACHE_HOME = "/home/zoey/.cache";
2024-05-23 20:26:30 +00:00
CLUTTER_BACKEND = "wayland";
DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox";
2025-05-06 20:02:36 -04:00
# # CachyOS-inspired Nvidia optimizations for gaming
# __GL_THREADED_OPTIMIZATIONS = "1";
# __GL_SHADER_DISK_CACHE = "1";
# __GL_SHADER_DISK_CACHE_SIZE = "1000000000";
# __GL_MaxFramesAllowed = "1"; # Reduces input latency
# __GL_YIELD = "USLEEP"; # Better CPU usage when GPU-bound
# DXVK_ASYNC = "1";
# DXVK_FRAME_RATE = "0"; # No frame rate cap from DXVK
# PROTON_ENABLE_NVAPI = "1";
# PROTON_HIDE_NVIDIA_GPU = "0";
# WINE_FULLSCREEN_FSR = "1"; # Enable FSR upscaling for Wine/Proton games
# MANGOHUD = "1"; # Enable MangoHud by default
# MANGOHUD_CONFIG = "cpu_temp,gpu_temp,vram,ram,position=top-left,height=500,font_size=20";
2024-05-23 20:26:30 +00:00
};
};
2025-05-06 20:02:36 -04:00
services.pulseaudio.support32Bit = true;
2024-05-23 20:26:30 +00:00
2025-01-09 13:33:20 -05:00
xdg.portal = {
enable = true;
extraPortals = [
2025-01-19 15:04:19 -05:00
# pkgs.xwaylandvideobridge
2025-01-09 13:33:20 -05:00
];
};
2024-05-23 20:26:30 +00:00
};
}