From 22464c272a656b54e301dda89b48331a84e893a1 Mon Sep 17 00:00:00 2001 From: chn Date: Sat, 25 May 2024 19:01:12 +0800 Subject: [PATCH] try to fix plasma6 --- modules/hardware/gpu.nix | 4 ++-- modules/system/gui.nix | 45 ++++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix index fc590a2d..5469c175 100644 --- a/modules/hardware/gpu.nix +++ b/modules/hardware/gpu.nix @@ -56,10 +56,10 @@ inputs: nvidia = inputs.lib.mkIf (builtins.elem "nvidia" gpus) { modesetting.enable = true; - powerManagement.enable = true; + powerManagement.enable = false; dynamicBoost.enable = inputs.lib.mkIf gpu.dynamicBoost true; nvidiaSettings = true; - forceFullCompositionPipeline = true; + # forceFullCompositionPipeline = true; # package = inputs.config.boot.kernelPackages.nvidiaPackages.production; prime.allowExternalGpu = true; }; diff --git a/modules/system/gui.nix b/modules/system/gui.nix index 388540d6..047e118c 100644 --- a/modules/system/gui.nix +++ b/modules/system/gui.nix @@ -6,31 +6,26 @@ inputs: preferred = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.enable; }; autoStart = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.preferred; }; }; - config = - let - inherit (builtins) map; - inherit (inputs.lib) mkIf; - inherit (inputs.config.nixos.system) gui; - in mkIf gui.enable + config = let inherit (inputs.config.nixos.system) gui; in inputs.lib.mkIf gui.enable + { + services = { - services = - { - displayManager = { sddm.enable = true; defaultSession = "plasma"; }; - desktopManager.plasma6.enable = true; - xserver.enable = true; - }; - systemd.services.display-manager.enable = gui.autoStart; - environment = - { - sessionVariables."GTK_USE_PORTAL" = "1"; - plasma6.excludePackages = inputs.lib.mkIf (!gui.preferred) [ inputs.pkgs.kdePackages.plasma-nm ]; - }; - xdg.portal.extraPortals = map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "kde" "wlr" ]; - i18n.inputMethod = - { - enabled = "fcitx5"; - fcitx5.addons = map (p: inputs.pkgs."fcitx5-${p}") [ "rime" "chinese-addons" "mozc" "nord" "material-color" ]; - }; - programs = { dconf.enable = true; xwayland.enable = true; }; + displayManager = { sddm = { enable = true; wayland.enable = true; }; defaultSession = "plasma"; }; + desktopManager.plasma6.enable = true; + xserver.enable = true; }; + systemd.services.display-manager.enable = gui.autoStart; + environment = + { + sessionVariables."GTK_USE_PORTAL" = "1"; + plasma6.excludePackages = inputs.lib.mkIf (!gui.preferred) [ inputs.pkgs.kdePackages.plasma-nm ]; + }; + xdg.portal.extraPortals = map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "kde" "wlr" ]; + i18n.inputMethod = + { + enabled = "fcitx5"; + fcitx5.addons = map (p: inputs.pkgs."fcitx5-${p}") [ "rime" "chinese-addons" "mozc" "nord" "material-color" ]; + }; + programs = { dconf.enable = true; xwayland.enable = true; }; + }; }