{ config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.modules.kde; in { options.nixfiles.modules.kde.enable = mkEnableOption "KDE Plasma"; config = mkIf cfg.enable { nixfiles.modules = { common.xdg.defaultApplications."org.kde.dolphin" = [ "inode/directory" ]; gnupg.pinentry = pkgs.pinentry-qt; sound.enable = true; }; hm = { # NOTE This will fail the home-manager service upon startup while a Plasma # session is not initialised. Something about dbus not being able to # communicate with presumably KDE configuration daemon. stylix.targets.kde.enable = true; programs.firefox.profiles.default.settings = { "widget.use-xdg-desktop-portal.file-picker" = 1; "widget.use-xdg-desktop-portal.mime-handler" = 1; }; gtk.theme = { package = mkForce pkgs.breeze-gtk; name = mkForce "Breeze"; }; xdg.configFile = { "fontconfig/conf.d/10-hm-fonts.conf".force = mkForce true; "mimeapps.list".force = mkForce true; "kcminputrc".text = generators.toINI { } { Keyboard = with config.services.xserver; { RepeatDelay = autoRepeatDelay; RepeatRate = autoRepeatInterval; }; }; "baloofilerc".text = generators.toINI { } { "Basic Settings"."Indexing-Enabled" = false; }; }; }; services = { desktopManager.plasma6.enable = true; displayManager.sddm = { enable = true; wayland = { enable = false; compositor = "kwin"; }; }; }; environment = { plasma6.excludePackages = with pkgs.kdePackages; [ elisa gwenview kate khelpcenter print-manager ]; systemPackages = with pkgs.kdePackages; [ plasma-disks ]; }; }; }