[Desktop/Plasma] add Plasma 6

Allow both desktops to exist at the same time.
Add "plasma6" environment option.
This commit is contained in:
Antoine Viallon 2024-05-25 13:36:39 +02:00
parent de2556ac4d
commit 8b9551bc86
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
7 changed files with 123 additions and 90 deletions

View file

@ -5,7 +5,7 @@ with lib;
./general.nix
./developer.nix
./multimedia.nix
./plasma.nix
./plasma
./games.nix
./browser.nix
./gnome.nix

View file

@ -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 {

View file

@ -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" <<EOF
[icon theme]
Inherits=''${XCURSOR_THEME:-breeze_cursors}
EOF
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
wantedBy = [ "graphical-session-pre.target" ];
partOf = [ "graphical-session-pre.target" ];
};
};
}

View file

@ -0,0 +1,48 @@
{config, pkgs, nixpkgs-unstable, lib, ...}:
with lib;
let
cfg = config.aviallon.desktop;
optimizeCfg = config.aviallon.optimizations;
in {
imports = [
./plasma5.nix
./plasma6.nix
];
config = mkIf (cfg.enable && (cfg.environment == "plasma" || cfg.environment == "plasma6" )) {
programs.firefox.enable = true;
programs.firefox.policies.Extensions.Install = [ "plasma-browser-integration@kde.org" ];
programs.chromium.extensions = [
"cimiefiiaegbelhefglklhhakcgmhkai" # Plasma Browser Integration
];
aviallon.desktop.sddm.enable = true;
aviallon.programs.libreoffice.qt = true;
xdg.portal.enable = mkDefault true;
xdg.icons.enable = true;
#environment.systemPackages = [
#config.programs.gnupg.agent.pinentryPackage
#];
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" <<EOF
[icon theme]
Inherits=''${XCURSOR_THEME:-breeze_cursors}
EOF
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
wantedBy = [ "graphical-session-pre.target" ];
partOf = [ "graphical-session-pre.target" ];
};
};
}

View file

@ -0,0 +1,24 @@
{ kdePackages }:
{
commonPackages = with kdePackages; [
skanpage
packagekit-qt
discover
akonadi
kmail
kdepim-addons
kdepim-runtime
calendarsupport
korganizer
dolphin
konsole
kate
yakuake
plasma-pa
ark
kolourpaint
krdc
sddm-kcm
];
}

View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.aviallon.desktop;
generic = import ./generic.nix {
kdePackages = pkgs.libsForQt5;
};
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;
};
environment.systemPackages = generic.commonPackages ++ [
pkgs.kio-fuse
];
# We prefer Plasma Wayland
services.displayManager.defaultSession = "plasmawayland";
};
}

View file

@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.aviallon.desktop;
generic = import ./generic.nix {
kdePackages = pkgs.kdePackages;
};
in {
config = mkIf (cfg.enable && (cfg.environment == "plasma6")) {
# Enable the Plasma 6 Desktop Environment.
services.desktopManager.plasma6 = {
enable = true;
};
environment.systemPackages = generic.commonPackages;
# We prefer Plasma Wayland
services.displayManager.defaultSession = "plasma";
};
}