{
  config,
  lib,
  pkgs,
  ...
}:
with lib;
let
  cfg = config.mjallen.programs.nwg-drawer;
  palette = import cfg.theme.file;
in
{
  imports = [ ./options.nix ];

  config = mkIf cfg.enable {
    home.packages = with pkgs; [ nwg-drawer ];

    home.file = {
      ".config/nwg-drawer/drawer.css".text = ''
        window {
            background-color: ${palette.colors.bg}bf;
            color: ${palette.colors.textMuted}00
        }

        /* search entry */
        entry {
            background-color: ${palette.colors.bgAlt}0f
        }

        button, image {
            background: none;
            border: none
        }

        button:hover {
            background-color: ${palette.colors.primary}1a
        }

        /* in case you wanted to give category buttons a different look */
        #category-button {
            margin: 0 10px 0 10px
        }

        #pinned-box {
            padding-bottom: 5px;
            border-bottom: 1px dotted ${palette.colors.border}
        }

        #files-box {
            padding: 5px;
            border: 1px dotted ${palette.colors.border};
            border-radius: 15px
        }
      '';
    };
  };
}
