From 8b9551bc862a7f02ce52dc47ca86529360827a7e Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Sat, 25 May 2024 13:36:39 +0200 Subject: [PATCH] [Desktop/Plasma] add Plasma 6 Allow both desktops to exist at the same time. Add "plasma6" environment option. --- desktop/default.nix | 2 +- desktop/general.nix | 2 +- desktop/plasma.nix | 88 -------------------------------------- desktop/plasma/default.nix | 48 +++++++++++++++++++++ desktop/plasma/generic.nix | 24 +++++++++++ desktop/plasma/plasma5.nix | 29 +++++++++++++ desktop/plasma/plasma6.nix | 20 +++++++++ 7 files changed, 123 insertions(+), 90 deletions(-) delete mode 100644 desktop/plasma.nix create mode 100644 desktop/plasma/default.nix create mode 100644 desktop/plasma/generic.nix create mode 100644 desktop/plasma/plasma5.nix create mode 100644 desktop/plasma/plasma6.nix diff --git a/desktop/default.nix b/desktop/default.nix index fce3e93..e5e7a62 100644 --- a/desktop/default.nix +++ b/desktop/default.nix @@ -5,7 +5,7 @@ with lib; ./general.nix ./developer.nix ./multimedia.nix - ./plasma.nix + ./plasma ./games.nix ./browser.nix ./gnome.nix diff --git a/desktop/general.nix b/desktop/general.nix index 9ebd4a0..6192dd8 100644 --- a/desktop/general.nix +++ b/desktop/general.nix @@ -14,7 +14,7 @@ in { environment = mkOption { default = "plasma"; example = "gnome"; - type = with types; enum [ "plasma" "gnome" ]; + type = with types; enum [ "plasma" "plasma6" "gnome" ]; description = "What Desktop Environment to use"; }; layout = mkOption { diff --git a/desktop/plasma.nix b/desktop/plasma.nix deleted file mode 100644 index 5b8654e..0000000 --- a/desktop/plasma.nix +++ /dev/null @@ -1,88 +0,0 @@ -{config, pkgs, nixpkgs-unstable, lib, ...}: -with lib; -let - cfg = config.aviallon.desktop; - optimizeCfg = config.aviallon.optimizations; -in { - - config = mkIf (cfg.enable && (cfg.environment == "plasma")) { - # Enable the Plasma 5 Desktop Environment. - services.xserver.desktopManager.plasma5 = { - enable = true; - runUsingSystemd = true; - useQtScaling = true; - - # Removed in: https://github.com/NixOS/nixpkgs/pull/172078 - # and: https://github.com/NixOS/nixpkgs/pull/221721 - # Once this (https://invent.kde.org/plasma/powerdevil/-/issues/19) is solved, make PR to add it back (prehaps by default?) - # supportDDC = true; - }; - - programs.firefox.enable = true; - - # Already brought in by ${nixpkgs}/nixos/modules/services/x11/desktop-managers/plasma5.nix - # programs.firefox.nativeMessagingHosts.packages = [ pkgs.libsForQt5.plasma-browser-integration ]; - - programs.firefox.policies.Extensions.Install = [ "plasma-browser-integration@kde.org" ]; - - environment.etc = { - "chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json".source = - "${pkgs.libsForQt5.plasma-browser-integration}/etc/chromium/native-messaging-hosts/org.kde.plasma.browser_integration.json"; - }; - - programs.chromium.extensions = [ - "cimiefiiaegbelhefglklhhakcgmhkai" # Plasma Browser Integration - ]; - - aviallon.desktop.sddm.enable = true; - - environment.systemPackages = with pkgs; with libsForQt5; [ - skanpage - packagekit-qt - discover - akonadi - kmail - kdepim-addons - kdepim-runtime - - korganizer - kalendar - dolphin - kio-fuse - konsole - kate - yakuake - pinentry-qt - plasma-pa - ark - kolourpaint - krdc - sddm-kcm - ]; - - aviallon.programs.libreoffice.qt = true; - - xdg.portal.enable = mkDefault true; - xdg.icons.enable = true; - - # We prefer Plasma Wayland - services.xserver.displayManager.defaultSession = "plasmawayland"; - - systemd.user.services.setup-xdg-cursors = mkIf config.xdg.icons.enable { - script = '' - [ -d "$HOME/.icons/default" ] || mkdir -p "$HOME/.icons/default" - cat >"$HOME/.icons/default/index.theme" <"$HOME/.icons/default/index.theme" <