main
 1{lib, ...}: {
 2  flake.modules.nixos.desktop = {config, ...}: {
 3    services.gvfs.enable = true; # Mount, trash, and other functionalities
 4    services.xserver.xkb.layout = "us";
 5    services.blueman.enable = config.hardware.bluetooth.enable;
 6    i18n.extraLocales = "all";
 7  };
 8
 9  flake.modules.homeManager.desktop = {config, ...}: {
10    # Fix some QT applications not following the color scheme, such as KDE Connect.
11    # See https://github.com/nix-community/stylix/issues/1958#issuecomment-3607824025
12    xdg.configFile.kdeglobals.source = let
13      themePackage = builtins.head (
14        builtins.filter (
15          p: builtins.match ".*stylix-kde-theme.*" (baseNameOf p) != null
16        )
17        config.home.packages
18      );
19      colorSchemeSlug = lib.concatStrings (
20        lib.filter lib.isString (builtins.split "[^a-zA-Z]" config.lib.stylix.colors.scheme)
21      );
22    in "${themePackage}/share/color-schemes/${colorSchemeSlug}.colors";
23
24    gtk.gtk4.theme = config.gtk.theme;
25  };
26}