mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-26 03:11:32 +01:00
fix: user environment variables do not take effects
This commit is contained in:
@@ -7,8 +7,8 @@ in rec {
|
||||
|
||||
home.homeDirectory = "/home/${username}";
|
||||
|
||||
# add environment variables
|
||||
systemd.user.sessionVariables = {
|
||||
# environment variables that always set at login
|
||||
home.sessionVariables = {
|
||||
# clean up ~
|
||||
LESSHISTFILE = cache + "/less/history";
|
||||
LESSKEY = c + "/less/lesskey";
|
||||
@@ -25,6 +25,4 @@ in rec {
|
||||
# enable scrolling in git diff
|
||||
DELTA_PAGER = "less -R";
|
||||
};
|
||||
|
||||
home.sessionVariables = systemd.user.sessionVariables;
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && cfg.nvidia) {
|
||||
systemd.user.sessionVariables = {
|
||||
wayland.windowManager.hyprland.settings.env = [
|
||||
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
|
||||
"LIBVA_DRIVER_NAME" = "nvidia";
|
||||
"XDG_SESSION_TYPE" = "wayland";
|
||||
"GBM_BACKEND" = "nvidia-drm";
|
||||
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"XDG_SESSION_TYPE,wayland"
|
||||
"GBM_BACKEND,nvidia-drm"
|
||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
||||
# fix https://github.com/hyprwm/Hyprland/issues/1520
|
||||
"WLR_NO_HARDWARE_CURSORS" = "1";
|
||||
};
|
||||
"WLR_NO_HARDWARE_CURSORS,1"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,14 @@
|
||||
enable = true;
|
||||
settings = {
|
||||
source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-hyprland}/themes/mocha.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"
|
||||
];
|
||||
};
|
||||
package = hyprland.packages.${pkgs.system}.hyprland;
|
||||
extraConfig = builtins.readFile ../conf/hyprland.conf;
|
||||
@@ -55,13 +63,4 @@
|
||||
|
||||
# allow fontconfig to discover fonts and configurations installed through home.packages
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
systemd.user.sessionVariables = {
|
||||
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";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,11 +10,18 @@ in {
|
||||
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";
|
||||
};
|
||||
};
|
||||
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