mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-27 19:27:05 +02:00
feat: environment variables for wayland & nvidia
This commit is contained in:
@@ -9,10 +9,6 @@ let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./options
|
||||
];
|
||||
|
||||
options.modules.desktop.hyprland = {
|
||||
enable = mkEnableOption "hyprland compositor";
|
||||
settings = lib.mkOption {
|
||||
@@ -38,14 +34,11 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge (
|
||||
[
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = cfg.settings;
|
||||
}
|
||||
]
|
||||
++ (import ./values args)
|
||||
)
|
||||
);
|
||||
config = mkIf cfg.enable (mkMerge ([
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = cfg.settings;
|
||||
}
|
||||
(import ./hyprland.nix args)
|
||||
(import ./xdg.nix args)
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -36,16 +36,7 @@ in
|
||||
"${configPath}/windowrules.conf"
|
||||
];
|
||||
env = [
|
||||
"NIXOS_OZONE_WL,1" # for any ozone-based browser & electron apps to run on wayland
|
||||
"MOZ_ENABLE_WAYLAND,1" # for firefox to run on wayland
|
||||
"MOZ_WEBRENDER,1"
|
||||
# misc
|
||||
"_JAVA_AWT_WM_NONREPARENTING,1"
|
||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
||||
"QT_QPA_PLATFORM,wayland"
|
||||
"SDL_VIDEODRIVER,wayland"
|
||||
"GDK_BACKEND,wayland"
|
||||
"XDG_SESSION_TYPE,wayland"
|
||||
|
||||
];
|
||||
};
|
||||
# gammastep/wallpaper-switcher need this to be enabled.
|
||||
@@ -1,4 +0,0 @@
|
||||
{ mylib, ... }:
|
||||
{
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
in
|
||||
{
|
||||
options.modules.desktop.hyprland = {
|
||||
nvidia = mkEnableOption "whether nvidia GPU is used";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && cfg.nvidia) {
|
||||
wayland.windowManager.hyprland.settings.env = [
|
||||
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
||||
# enable native Wayland support for most Electron apps
|
||||
"ELECTRON_OZONE_PLATFORM_HINT,auto"
|
||||
# VA-API hardware video acceleration
|
||||
"NVD_BACKEND,direct"
|
||||
|
||||
"GBM_BACKEND,nvidia-drm"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ mylib, ... }@args: map (path: import path args) (mylib.scanPaths ./.)
|
||||
Reference in New Issue
Block a user