From fb830c03eefaf30d2708e6e5bc0b821d58f7d6cf Mon Sep 17 00:00:00 2001 From: Joshua Yuen Date: Sun, 27 Jul 2025 16:27:41 -0400 Subject: [PATCH] Add plasma option --- hosts/vm/default.nix | 3 ++- modules/core/default.nix | 1 + modules/core/plasma.nix | 14 ++++++++++++++ modules/core/sddm.nix | 3 +++ modules/home/xdg.nix | 21 +++++++++++++++------ modules/options/default.nix | 1 + modules/options/plasma.nix | 14 ++++++++++++++ 7 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 modules/core/plasma.nix create mode 100644 modules/options/plasma.nix diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix index ba821c6..5ad7946 100644 --- a/hosts/vm/default.nix +++ b/hosts/vm/default.nix @@ -13,7 +13,8 @@ ]; modules.hyprland.enable = true; - modules.displayManager.displayManager = "gdm"; + modules.plasma.enable = true; + modules.displayManager.displayManager = "sddm"; modules.zsh.enable = true; modules.shell.defaultShell = "zsh"; diff --git a/modules/core/default.nix b/modules/core/default.nix index a72a0a2..c682311 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -6,6 +6,7 @@ ./gdm.nix ./hyprland.nix ./packages.nix + ./plasma.nix ./sddm.nix ./system.nix ./user.nix diff --git a/modules/core/plasma.nix b/modules/core/plasma.nix new file mode 100644 index 0000000..33ae2aa --- /dev/null +++ b/modules/core/plasma.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + ... +}: +with lib; +let + cfg = config.modules.plasma; +in +{ + config = mkIf cfg.enable { + services.desktopManager.plasma6.enable = true; + }; +} \ No newline at end of file diff --git a/modules/core/sddm.nix b/modules/core/sddm.nix index 5cb55ed..753945d 100644 --- a/modules/core/sddm.nix +++ b/modules/core/sddm.nix @@ -12,6 +12,9 @@ in services.displayManager.sddm = { enable = true; wayland.enable = true; + settings = { + General.DisplayServer = "wayland"; + }; }; # To prevent getting stuck at shutdown diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix index 3b90d50..614e039 100644 --- a/modules/home/xdg.nix +++ b/modules/home/xdg.nix @@ -7,6 +7,7 @@ with lib; let hyprlandCfg = osConfig.modules.hyprland; + plasmaCfg = osConfig.modules.plasma; in { xdg = { @@ -15,12 +16,20 @@ in mimeApps.enable = true; portal = { enable = true; - extraPortals = mkIf hyprlandCfg.enable [ - pkgs.xdg-desktop-portal-hyprland - ]; - configPackages = mkIf hyprlandCfg.enable [ - pkgs.hyprland - ]; + extraPortals = [] + ++ (if hyprlandCfg.enable + then [ pkgs.xdg-desktop-portal-hyprland ] + else []) + ++ (if plasmaCfg.enable + then [ pkgs.kdePackages.xdg-desktop-portal-kde ] + else []); + configPackages = [] + ++ (if hyprlandCfg.enable + then [ pkgs.hyprland ] + else []) + ++ (if plasmaCfg.enable + then [ pkgs.kdePackages.kde-gtk-config ] + else []); }; }; } \ No newline at end of file diff --git a/modules/options/default.nix b/modules/options/default.nix index 3105538..dd4a8b3 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -5,6 +5,7 @@ imports = [ ./displayManager.nix ./hyprland.nix + ./plasma.nix ./shell.nix ./zsh.nix ]; diff --git a/modules/options/plasma.nix b/modules/options/plasma.nix new file mode 100644 index 0000000..5458dbe --- /dev/null +++ b/modules/options/plasma.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + ... +}: +with lib; +let + cfg = config.modules.plasma; +in +{ + options.modules.plasma = { + enable = mkEnableOption "Enable Plasma"; + }; +} \ No newline at end of file