feat: modular i3's configurations

This commit is contained in:
Ryan Yin
2023-12-24 22:49:13 +08:00
parent 3aaaeb49ca
commit 30881f356a
27 changed files with 20 additions and 20 deletions
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
+20
View File
@@ -0,0 +1,20 @@
{
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) {
systemd.user.sessionVariables = {
"LIBVA_DRIVER_NAME" = "nvidia";
"GBM_BACKEND" = "nvidia-drm";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
};
};
}