mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 01:38:28 +02:00
refactor(home/linux/desktop): home/linux/desktop => home/linux/gui
This commit is contained in:
3
home/linux/gui/i3/options/default.nix
Normal file
3
home/linux/gui/i3/options/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
27
home/linux/gui/i3/options/nvidia.nix
Normal file
27
home/linux/gui/i3/options/nvidia.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.modules.desktop.i3;
|
||||
in {
|
||||
options.modules.desktop.i3 = {
|
||||
nvidia = mkEnableOption "whether nvidia GPU is used";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && cfg.nvidia) (
|
||||
let
|
||||
env = {
|
||||
"LIBVA_DRIVER_NAME" = "nvidia";
|
||||
"GBM_BACKEND" = "nvidia-drm";
|
||||
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
|
||||
};
|
||||
in {
|
||||
# environment set for systemd's user session
|
||||
systemd.user.sessionVariables = env;
|
||||
# environment set at user login
|
||||
home.sessionVariables = env;
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user