{ config, lib, pkgs, ... }: with lib; let hyprlandCfg = config.modules.hyprland; pipewireCfg = config.modules.pipewire; plasmaCfg = config.modules.plasma; in { xdg = { enable = true; mime.enable = true; mimeApps.enable = true; portal = mkIf (hyprlandCfg.enable or plasmaCfg.enable) { enable = true; extraPortals = [ ] ++ (if hyprlandCfg.enable then [ pkgs.xdg-desktop-portal-hyprland ] else [ ]) ++ ( if pipewireCfg.enable then [ pkgs.xdg-desktop-portal-wlr pkgs.xdg-desktop-portal-gtk ] else [ ] ) ++ (if plasmaCfg.enable then [ pkgs.kdePackages.xdg-desktop-portal-kde ] else [ ]); configPackages = [ ] ++ (if hyprlandCfg.enable then [ pkgs.hyprland ] else [ ]) ++ ( if plasmaCfg.enable # TODO: use the correct packages or config then [ pkgs.kdePackages.kde-gtk-config ] else [ ] ); }; }; }