{
  config,
  lib,
  namespace,
  ...
}:
with lib;
let
  cfg = config.${namespace}.programs.nwg-panel;
in
{
  imports = [ ./options.nix ];

  config = mkIf cfg.enable {
    home.file = {
      ".config/nwg-panel/excluded-dirs".text = ''

      '';
      ".config/nwg-panel/preferred-apps.json".text = ''
        {
          "\\.pdf$": "${cfg.defaultApps.browser.pname}",
          "\\.svg$": "inkscape",
          "\\.(jpg|png|tiff|gif)$": "${cfg.defaultApps.imageViewer.pname}",
          "\\.(mp3|ogg|flac|wav|wma)$": "audacious",
          "\\.(avi|mp4|mkv|mov|wav)$": "${cfg.defaultApps.video.pname}",
          "\\.(doc|docx|xls|xlsx)$": "${cfg.defaultApps.office.pname}"
        }
      '';
    };
  };
}
