nix-dotfiles/modules/desktop/default.nix

43 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop;
in {
options.modules.desktop = {
envProto = mkOption {
type = types.nullOr (types.enum ["x11" "wayland"]);
description = "What display protocol to use";
};
};
config = mkMerge [
{
qt = {
enable = true;
platformTheme = "gnome";
style = "adwaita-dark";
};
modules.desktop.fonts.enable = true;
modules.desktop.fonts.baseFonts = true;
}
(mkIf (cfg.envProto == "wayland") {
environment.sessionVariables = {
# magic, dont ask
NIXOS_OZONE_WL = "1";
_JAVA_AWT_WM_NONEREPARENTING = "1";
GDK_BACKEND = "wayland,x11";
ANKI_WAYLAND = "1";
XDG_SESSION_TYPE = "wayland";
SDL_VIDEODRIVER = "wayland";
CLUTTER_BACKEND = "wayland";
# this fixes cursors on nvidia, maybe move all nvidia stuff to a module? or put this in hardware
WLR_NO_HARDWARE_CURSORS = "1";
};
})
(mkIf (cfg.envProto == "x11") {
services.xserver.excludePackages = [ pkgs.xterm ];
})
];
}