KDE: Difference between revisions

From NixOS Wiki
Jump to: navigation, search
Jkotran (talk | contribs)
m Linked to Plasma-Manager page.
Jkotran (talk | contribs)
m Lesson learned: NixOS Plasma module enables Pipewire by default.
 
Line 12: Line 12:
services = {
services = {
   desktopManager.plasma6.enable = true;
   desktopManager.plasma6.enable = true;
   displayManager.sddm.enable = true;
   displayManager.sddm.enable = true;
   displayManager.sddm.wayland.enable = true;
   displayManager.sddm.wayland.enable = true;
};
};


environment.systemPackages = with pkgs;
environment.systemPackages = with pkgs; [
   [
   # KDE Utilities
    # KDE
  kdePackages.discover # Optional: Software center for Flatpaks/firmware updates
    kdePackages.discover # Optional: Install if you use Flatpak or fwupd firmware update sevice
  kdePackages.kcalc # Calculator
    kdePackages.kcalc # Calculator
  kdePackages.kcharselect # Character map
    kdePackages.kcharselect # Tool to select and copy special characters from all installed fonts
  kdePackages.kclock # Clock app
    kdePackages.kclock # Clock app
  kdePackages.kcolorchooser # Color picker
    kdePackages.kcolorchooser # A small utility to select a color
  kdePackages.kolourpaint # Simple paint program
    kdePackages.kolourpaint # Easy-to-use paint program
  kdePackages.ksystemlog # System log viewer
    kdePackages.ksystemlog # KDE SystemLog Application
  kdePackages.sddm-kcm # SDDM configuration module
    kdePackages.sddm-kcm # Configuration module for SDDM
  kdiff3 # File/directory comparison tool
    kdiff3 # Compares and merges 2 or 3 files or directories
 
    kdePackages.isoimagewriter # Optional: Program to write hybrid ISO files onto USB disks
  # Hardware/System Utilities (Optional)
    kdePackages.partitionmanager # Optional: Manage the disk devices, partitions and file systems on your computer
  kdePackages.isoimagewriter # Write hybrid ISOs to USB
    # Non-KDE graphical packages
  kdePackages.partitionmanager # Disk and partition management
    hardinfo2 # System information and benchmarks for Linux systems
  hardinfo2 # System benchmarks and hardware info
    vlc # Cross-platform media player and streaming server
  wayland-utils # Wayland diagnostic tools
    wayland-utils # Wayland utilities
  wl-clipboard # Wayland copy/paste support
    wl-clipboard # Command-line copy/paste utilities for Wayland
   vlc # Media player
   ];
];
</syntaxHighlight>
</syntaxHighlight>


=== Remote Desktop Service ===
=== Remote Desktop Service (RDP) ===
 
To use KDE Plasma 6 on a computer and share the GUI desktop with RDP (remote desktop access), add this to your configuration.nix. After applying the configuration, you can connect to the GUI desktop from another computer with an RDP client such as Remmina or Microsoft's Windows app.


Note: As of May 2025, the xrdp service still requires X11 instead of Wayland.
To use KDE Plasma 6 with remote desktop access via RDP, add the following. Note that as of early 2026, the `xrdp` service still relies on an X11 session.


Note: Local login and remote login via RDP will have separate sessions. If you login locally and later login remotely, xrdp will launch a new session instead of connecting you to the locally logged in session.
''Note: Local and remote logins will create separate user sessions.''


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
services = {
services = {
   desktopManager.plasma6.enable = true;
   desktopManager.plasma6.enable = true;
   displayManager.sddm.enable = true;
   displayManager.sddm.enable = true;


   xrdp = {
   xrdp = {
    enable = true;
     defaultWindowManager = "startplasma-x11";
     defaultWindowManager = "startplasma-x11";
    enable = true;
     openFirewall = true;
     openFirewall = true;
   };
   };
Line 62: Line 57:
   xserver = {
   xserver = {
     enable = true;
     enable = true;
     xkb = {
     xkb = {
       layout = "us";
       layout = "us";
Line 70: Line 64:
};
};


environment.systemPackages = with pkgs;
environment.systemPackages = with pkgs; [
   [
   wayland-utils
    # KDE
  wl-clipboard
    kdePackages.discover # Optional: Install if you use Flatpak or fwupd firmware update sevice
  xclip # Required for clipboard support over X11 RDP sessions
    kdePackages.kcalc # Calculator
];
    kdePackages.kcharselect # Tool to select and copy special characters from all installed fonts
    kdePackages.kclock # Clock app
    kdePackages.kcolorchooser # A small utility to select a color
    kdePackages.kolourpaint # Easy-to-use paint program
    kdePackages.ksystemlog # KDE SystemLog Application
    kdePackages.sddm-kcm # Configuration module for SDDM
    kdiff3 # Compares and merges 2 or 3 files or directories
    kdePackages.isoimagewriter # Optional: Program to write hybrid ISO files onto USB disks
    kdePackages.partitionmanager # Optional: Manage the disk devices, partitions and file systems on your computer
    # Non-KDE graphical packages
    hardinfo2 # System information and benchmarks for Linux systems
    vlc # Cross-platform media player and streaming server
    wayland-utils # Wayland utilities
    wl-clipboard # Command-line copy/paste utilities for Wayland
    xclip # Tool to access the X clipboard from a console application
  ];
</syntaxHighlight>
</syntaxHighlight>


=== Excluding KDE Plasma Applications ===
=== Excluding Default Applications ===


This example demonstrates how to exclude some KDE Plasma apps.
If you prefer a more minimal installation, you can exclude specific packages that are bundled with the Plasma 6 module:


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
  #
environment.plasma6.excludePackages = with pkgs; [
  # KDE Exclusions
  kdePackages.elisa # Music player
  #
  kdePackages.kdepim-runtime # Akonadi agents
  environment.plasma6.excludePackages = with pkgs; [
  kdePackages.kmahjongg
    kdePackages.elisa # Simple music player aiming to provide a nice experience for its users
  kdePackages.kmines
    kdePackages.kdepim-runtime # Akonadi agents and resources
  kdePackages.konversation # IRC client
    kdePackages.kmahjongg # KMahjongg is a tile matching game for one or two players
  kdePackages.kpat # Solitaire
    kdePackages.kmines # KMines is the classic Minesweeper game
  kdePackages.ksudoku
    kdePackages.konversation # User-friendly and fully-featured IRC client
  kdePackages.ktorrent
    kdePackages.kpat # KPatience offers a selection of solitaire card games
];
    kdePackages.ksudoku # KSudoku is a logic-based symbol placement puzzle
    kdePackages.ktorrent # Powerful BitTorrent client
    mpv
  ];
</syntaxHighlight>
</syntaxHighlight>


=== Audio ===
== Audio ==


[[PipeWire|Enable PipeWire Audio Support]]
NixOS 24.11+ uses [[PipeWire]] as the modern audio backend.


=== Bluetooth ===
'''Important Note:''' Enabling KDE Plasma 6 via `services.desktopManager.plasma6.enable = true;` will automatically set `services.pipewire.enable = true;` by default.


[[Bluetooth|Enable Bluetooth Support]]
If you are running KDE in a specialized environment where you must disable PipeWire (such as a container, a VM for testing, or a headless node), you must use `lib.mkForce` to override the Plasma 6 default:
 
<syntaxHighlight lang=nix>
services.pipewire.enable = lib.mkForce false;
</syntaxHighlight>
 
== Bluetooth ==
 
To ensure full functionality of Bluetooth applets and audio switching in Plasma, see the [[Bluetooth]] page to enable support.


== Configuration Management ==
== Configuration Management ==
Line 126: Line 108:
=== Plasma-Manager ===
=== Plasma-Manager ===


Plasma-Manager provides automation and configuration management for KDE. If you have more than a handful of machines, give it a look. It's well regarded by folks on [https://www.reddit.com/r/NixOS/comments/1lbv8hn/ive_avoided_kde_for_years_because_of_dotfile/ Reddit /r/NixOS]
Plasma-Manager provides declarative configuration for KDE Plasma settings, allowing you to manage shortcuts, wallpapers, and panels via Nix. It is highly recommended for users managing multiple machines.
 
[https://github.com/nix-community/plasma-manager Github plasma-manager]


[[Plasma-Manager|NixOS Wiki Plasma-Manager]]
* [https://github.com/nix-community/plasma-manager GitHub: Plasma-Manager]
* [[Plasma-Manager|NixOS Wiki: Plasma-Manager]]


[[Category:Desktop environment]]
[[Category:Desktop environment]]
[[Category:Applications]]
[[Category:Applications]]

Latest revision as of 20:23, 25 February 2026

KDE Plasma is a desktop environment that aims to be simple by default, powerful when needed.

Note: As of 2024, KDE Plasma 5 is end of life and X11 is deprecated. In general you should aim for KDE Plasma 6 and Wayland.

Installation

Contemporary Setup

To use KDE Plasma 6 on a computer running NixOS 24.11 or later, add this to your configuration.nix:

services = {
  desktopManager.plasma6.enable = true;
  displayManager.sddm.enable = true;
  displayManager.sddm.wayland.enable = true;
};

environment.systemPackages = with pkgs; [
  # KDE Utilities
  kdePackages.discover # Optional: Software center for Flatpaks/firmware updates
  kdePackages.kcalc # Calculator
  kdePackages.kcharselect # Character map
  kdePackages.kclock # Clock app
  kdePackages.kcolorchooser # Color picker
  kdePackages.kolourpaint # Simple paint program
  kdePackages.ksystemlog # System log viewer
  kdePackages.sddm-kcm # SDDM configuration module
  kdiff3 # File/directory comparison tool
  
  # Hardware/System Utilities (Optional)
  kdePackages.isoimagewriter # Write hybrid ISOs to USB
  kdePackages.partitionmanager # Disk and partition management
  hardinfo2 # System benchmarks and hardware info
  wayland-utils # Wayland diagnostic tools
  wl-clipboard # Wayland copy/paste support
  vlc # Media player
];

Remote Desktop Service (RDP)

To use KDE Plasma 6 with remote desktop access via RDP, add the following. Note that as of early 2026, the `xrdp` service still relies on an X11 session.

Note: Local and remote logins will create separate user sessions.

services = {
  desktopManager.plasma6.enable = true;
  displayManager.sddm.enable = true;

  xrdp = {
    enable = true;
    defaultWindowManager = "startplasma-x11";
    openFirewall = true;
  };

  xserver = {
    enable = true;
    xkb = {
      layout = "us";
      variant = "";
    };
  };
};

environment.systemPackages = with pkgs; [
  wayland-utils
  wl-clipboard
  xclip # Required for clipboard support over X11 RDP sessions
];

Excluding Default Applications

If you prefer a more minimal installation, you can exclude specific packages that are bundled with the Plasma 6 module:

environment.plasma6.excludePackages = with pkgs; [
  kdePackages.elisa # Music player
  kdePackages.kdepim-runtime # Akonadi agents
  kdePackages.kmahjongg
  kdePackages.kmines
  kdePackages.konversation # IRC client
  kdePackages.kpat # Solitaire
  kdePackages.ksudoku
  kdePackages.ktorrent
];

Audio

NixOS 24.11+ uses PipeWire as the modern audio backend.

Important Note: Enabling KDE Plasma 6 via `services.desktopManager.plasma6.enable = true;` will automatically set `services.pipewire.enable = true;` by default.

If you are running KDE in a specialized environment where you must disable PipeWire (such as a container, a VM for testing, or a headless node), you must use `lib.mkForce` to override the Plasma 6 default:

services.pipewire.enable = lib.mkForce false;

Bluetooth

To ensure full functionality of Bluetooth applets and audio switching in Plasma, see the Bluetooth page to enable support.

Configuration Management

Plasma-Manager

Plasma-Manager provides declarative configuration for KDE Plasma settings, allowing you to manage shortcuts, wallpapers, and panels via Nix. It is highly recommended for users managing multiple machines.