diff options
| -rw-r--r-- | modules/default.nix | 1 | ||||
| -rw-r--r-- | modules/software/default.nix | 1 | ||||
| -rw-r--r-- | modules/software/variables.nix | 76 | ||||
| -rw-r--r-- | modules/variables/default.nix | 20 | ||||
| -rw-r--r-- | modules/variables/electron.nix | 7 | ||||
| -rw-r--r-- | modules/variables/fcitx.nix | 13 | ||||
| -rw-r--r-- | modules/variables/mozilla.nix | 6 | ||||
| -rw-r--r-- | modules/variables/nvidia.nix | 12 | ||||
| -rw-r--r-- | modules/variables/opengl.nix | 7 | ||||
| -rw-r--r-- | modules/variables/qt.nix | 11 | ||||
| -rw-r--r-- | modules/variables/wayland.nix | 10 | ||||
| -rw-r--r-- | modules/variables/wlroots.nix | 12 |
12 files changed, 99 insertions, 77 deletions
diff --git a/modules/default.nix b/modules/default.nix index 77eb357..44da8e2 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,6 +5,7 @@ ./nix ./security ./software + ./variables ./virtualisation ]; } diff --git a/modules/software/default.nix b/modules/software/default.nix index 1c1593a..ff34766 100644 --- a/modules/software/default.nix +++ b/modules/software/default.nix @@ -14,7 +14,6 @@ ./shell.nix ./systemd.nix ./users.nix - ./variables.nix ]; system = { diff --git a/modules/software/variables.nix b/modules/software/variables.nix deleted file mode 100644 index db06919..0000000 --- a/modules/software/variables.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ pkgs, ... }: -{ - environment.variables = { - # OpenGL - __GL_GSYNC_ALLOWED = "1"; - __GL_VRR_ALLOWED = "0"; - __GL_MaxFramesAllowed = "1"; - - # Java - _JAVA_AWT_WM_NONREPARENTING = "1"; - - # Qt - QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - QT_QPA_PLATFORM = "wayland;xcb"; - DISABLE_QT5_COMPAT = "0"; - DISABLE_QT_COMPAT = "0"; - QT_QPA_PLATFORMTHEME = "qt5ct"; - # QT_STYLE_OVERRIDE = "kvantum"; - - # Electron - # ELECTRON_OZONE_PLATFORM_HINT = "auto"; - # OZONE_PLATFORM = "wayland"; - NIXOS_OZONE_WL = "1"; - - # Proton - PROTON_ENABLE_NGX_UPDATER = "1"; - - # wlroots - WLR_NO_HARDWARE_CURSORS = "1"; - WLR_DRM_NO_ATOMIC = "1"; - WLR_USE_LIBINPUT = "1"; - WLR_RENDERER_ALLOW_SOFTWARE = "1"; - WLR_DRM_DEVICES = "/dev/dri/card0"; - WLR_EGL_NO_MODIFIERS = "1"; - WLR_BACKEND = "vulkan"; - WLR_RENDERER = "vulkan"; - - # Mozilla - MOZ_ENABLE_WAYLAND = "1"; - MOZ_DISABLE_RDD_SANDBOX = "1"; - - # Nvidia - LIBVA_DRIVER_NAME = "nvidia"; - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - GBM_BACKEND = "nvidia-drm"; - __VK_LAYER_NV_optimus = "NVIDIA_only"; - __NV_PRIME_RENDER_OFFLOAD = "1"; - NVD_BACKEND = "direct"; - CUDA_PATH = "${pkgs.cudatoolkit}"; - - # Fcitx - # https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland - QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - # GTK_IM_MODULE = "wayland"; - # GTK_IM_MODULE = "fcitx"; - SDL_IM_MODULE = "fcitx"; - GLFW_IM_MODULE = "ibus"; - INPUT_METHOD = "fcitx"; - CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv"; - - # Other Wayland - GDK_BACKEND = "wayland,x11,*"; - SDL_VIDEODRIVER = "wayland"; - CLUTTER_BACKEND = "wayland"; - XWAYLAND_NO_GLAMOR = "1"; # Gamescope - ANKI_WAYLAND = "1"; - XDG_SESSION_TYPE = "wayland"; - - # Other - GTK_USE_PORTAL = "1"; - DIRENV_LOG_FORMAT = ""; - SSH_AUTH_SOCK = "/run/user/1000/keyring/ssh"; - }; -} diff --git a/modules/variables/default.nix b/modules/variables/default.nix new file mode 100644 index 0000000..8315ceb --- /dev/null +++ b/modules/variables/default.nix @@ -0,0 +1,20 @@ +{ + imports = [ + ./electron.nix + ./fcitx.nix + ./mozilla.nix + ./nvidia.nix + ./opengl.nix + ./qt.nix + ./wayland.nix + ./wlroots.nix + ]; + + environment.variables = { + _JAVA_AWT_WM_NONREPARENTING = "1"; + PROTON_ENABLE_NGX_UPDATER = "1"; + GTK_USE_PORTAL = "1"; + DIRENV_LOG_FORMAT = ""; + SSH_AUTH_SOCK = "/run/user/1000/keyring/ssh"; + }; +} diff --git a/modules/variables/electron.nix b/modules/variables/electron.nix new file mode 100644 index 0000000..62e7c72 --- /dev/null +++ b/modules/variables/electron.nix @@ -0,0 +1,7 @@ +{ + environment.variables = { + # ELECTRON_OZONE_PLATFORM_HINT = "auto"; + # OZONE_PLATFORM = "wayland"; + NIXOS_OZONE_WL = "1"; + }; +} diff --git a/modules/variables/fcitx.nix b/modules/variables/fcitx.nix new file mode 100644 index 0000000..0ac550f --- /dev/null +++ b/modules/variables/fcitx.nix @@ -0,0 +1,13 @@ +{ + environment.variables = { + # https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + # GTK_IM_MODULE = "wayland"; + # GTK_IM_MODULE = "fcitx"; + SDL_IM_MODULE = "fcitx"; + GLFW_IM_MODULE = "ibus"; + INPUT_METHOD = "fcitx"; + CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv"; + }; +} diff --git a/modules/variables/mozilla.nix b/modules/variables/mozilla.nix new file mode 100644 index 0000000..e85d27c --- /dev/null +++ b/modules/variables/mozilla.nix @@ -0,0 +1,6 @@ +{ + environment.variables = { + MOZ_ENABLE_WAYLAND = "1"; + MOZ_DISABLE_RDD_SANDBOX = "1"; + }; +} diff --git a/modules/variables/nvidia.nix b/modules/variables/nvidia.nix new file mode 100644 index 0000000..3d50fdf --- /dev/null +++ b/modules/variables/nvidia.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + environment.variables = { + LIBVA_DRIVER_NAME = "nvidia"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + GBM_BACKEND = "nvidia-drm"; + __VK_LAYER_NV_optimus = "NVIDIA_only"; + __NV_PRIME_RENDER_OFFLOAD = "1"; + NVD_BACKEND = "direct"; + CUDA_PATH = "${pkgs.cudatoolkit}"; + }; +} diff --git a/modules/variables/opengl.nix b/modules/variables/opengl.nix new file mode 100644 index 0000000..1edce45 --- /dev/null +++ b/modules/variables/opengl.nix @@ -0,0 +1,7 @@ +{ + environment.variables = { + __GL_GSYNC_ALLOWED = "1"; + __GL_VRR_ALLOWED = "0"; + __GL_MaxFramesAllowed = "1"; + }; +} diff --git a/modules/variables/qt.nix b/modules/variables/qt.nix new file mode 100644 index 0000000..cedf6a0 --- /dev/null +++ b/modules/variables/qt.nix @@ -0,0 +1,11 @@ +{ + environment.variables = { + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + DISABLE_QT5_COMPAT = "0"; + DISABLE_QT_COMPAT = "0"; + QT_QPA_PLATFORMTHEME = "qt5ct"; + # QT_STYLE_OVERRIDE = "kvantum"; + }; +} diff --git a/modules/variables/wayland.nix b/modules/variables/wayland.nix new file mode 100644 index 0000000..c1a51d9 --- /dev/null +++ b/modules/variables/wayland.nix @@ -0,0 +1,10 @@ +{ + environment.variables = { + GDK_BACKEND = "wayland,x11,*"; + SDL_VIDEODRIVER = "wayland"; + CLUTTER_BACKEND = "wayland"; + XWAYLAND_NO_GLAMOR = "1"; # Gamescope + ANKI_WAYLAND = "1"; + XDG_SESSION_TYPE = "wayland"; + }; +} diff --git a/modules/variables/wlroots.nix b/modules/variables/wlroots.nix new file mode 100644 index 0000000..25aaf4d --- /dev/null +++ b/modules/variables/wlroots.nix @@ -0,0 +1,12 @@ +{ + environment.variables = { + WLR_NO_HARDWARE_CURSORS = "1"; + WLR_DRM_NO_ATOMIC = "1"; + WLR_USE_LIBINPUT = "1"; + WLR_RENDERER_ALLOW_SOFTWARE = "1"; + WLR_DRM_DEVICES = "/dev/dri/card0"; + WLR_EGL_NO_MODIFIERS = "1"; + WLR_BACKEND = "vulkan"; + WLR_RENDERER = "vulkan"; + }; +} |