about summary refs log tree commit diff
path: root/modules/nixos/kde.nix
blob: 3822415ec2ecb933fda71eab165e53c7035935d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  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 = "qt";
      sound.enable = true;
    };

    hm = {
      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.xserver = {
      desktopManager.plasma6.enable = true;
      displayManager.sddm.enable = true;
    };

    environment = {
      systemPackages = with pkgs; [pinentry-qt];
      plasma6.excludePackages = with pkgs.kdePackages; [
        elisa
        gwenview
        kate
        khelpcenter
        print-manager
      ];
    };
  };
}

Consider giving Nix/NixOS a try! <3