{
  self,
  pkgs,
  lib,
  config,
  ...
}:
let
  inherit (lib.my) slugify;

  mkURLEntry = name: url: icon: {
    name = slugify name;
    value = {
      inherit name icon;
      terminal = false;
      exec = "${pkgs.xdg-utils}/bin/xdg-open \"${url}\"";
    };
  };
in
{
  xdg = {
    desktopEntries = builtins.listToAttrs [
      (mkURLEntry "Paperless" "https://paperless.ccnlc.eu" "${self}/assets/favicon-paperless.png")
      (mkURLEntry "KitchenOwl" "https://kitchenowl.ccnlc.eu" "${self}/assets/favicon-kitchenowl.png")
      (mkURLEntry "Discord" "https://discord.com/app" "${self}/assets/favicon-discord.png")
    ];

    userDirs =
      let
        home = config.home.homeDirectory;
        disable =
          a:
          lib.listToAttrs (
            lib.map (key: {
              name = key;
              value = null;
            }) a
          );
      in
      (lib.mapAttrs (_: folder: "${home}/${folder}") {
        download = "downloads";
        videos = "videos";
        pictures = "pictures";
      })
      // (disable [
        "music"
        "documents"
        "templates"
        "publicShare"
        "desktop"
      ])
      // {
        enable = true;
        createDirectories = true;
        extraConfig = {
          XDG_DEVEL_DIR = "${home}/devel";
        };
      };
  };
}
