{
  config,
  pkgs,
  ...
}: {
  imports = [
    ./base.nix
  ];

  programs.emacs = {
    enable = true;
    package = pkgs.emacs-pgtk;
  };

  programs.firefox = {
    enable = true;
    nativeMessagingHosts = [pkgs.firefoxpwa];
    profiles = {
      default = {
        id = 0;
        name = "default";
        isDefault = true;
        extensions = {
          packages = with pkgs.nur.repos.rycee.firefox-addons; [
            awesome-rss
            betterttv
            bitwarden
            clearurls
            control-panel-for-twitter
            enhancer-for-youtube
            facebook-container
            flagfox
            istilldontcareaboutcookies
            linkwarden
            privacy-badger
            return-youtube-dislikes
            search-by-image
            sponsorblock
            tab-session-manager
            tampermonkey
            ublock-origin
            windscribe
          ];
        };
        settings = {
          "browser.formfill.enable" = false;
          "browser.ml.chat.enabled" = false;
          "browser.ml.chat.shortcuts" = false;
          "browser.ml.chat.sidebar" = false;
          "browser.newtabpage.activity-stream.feeds.section.topstories" = false;
          "browser.newtabpage.activity-stream.feeds.snippets" = false;
          "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
          "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
          "browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
          "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
          "browser.newtabpage.activity-stream.showSponsored" = false;
          "browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
          "browser.newtabpage.activity-stream.system.showSponsored" = false;
          "browser.topsites.contile.enabled" = false;
          "browser.urlbar.unitConversion.enabled" = true;
          "extensions.formautofill.addresses.enabled" = false;
          "extensions.formautofill.creditCards.enabled" = false;
          "extensions.pocket.enabled" = false;
          "general.autoScroll" = true;
          "widget.use-xdg-desktop-portal.file-picker" = 1;
          "signon.rememberSignons" = false;
        };
        search = {
          force = true;
          default = "SearX";
          order = ["SearX" "google"];
          engines = {
            "MELPA" = {
              urls = [
                {
                  template = "https://melpa.org/#/?q={searchTerms}";
                }
              ];
              definedAliases = ["@m"];
            };
            "Nix Packages" = {
              urls = [
                {
                  template = "https://search.nixos.org/packages";
                  params = [
                    {
                      name = "type";
                      value = "packages";
                    }
                    {
                      name = "query";
                      value = "{searchTerms}";
                    }
                  ];
                }
              ];
              icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
              definedAliases = ["@np"];
            };
            "SearX" = {
              urls = [{template = "https://searx.traphouse.cathoderaytube.net/?q={searchTerms}";}];
              definedAliases = ["@searx"];
            };
            "bing".metaData.hidden = true;
          };
        };
      };
    };
  };

  programs.kitty = {
    enable = true;
    enableGitIntegration = true;
    shellIntegration = {
      enableBashIntegration = true;
      enableZshIntegration = true;
    };
    font = {
      name = "BlexMono Nerd Font";
      size = 11;
    };
  };

  programs.mpv = {
    enable = true;
    config = {
      profile = "gpu-hq";
      ytdl-format = "bestvideo+bestaudio";
    };
    scripts = [
      pkgs.mpvScripts.mpris
      pkgs.mpvScripts.sponsorblock
    ];
  };

  programs.obs-studio.enable = true;

  programs.rofi = {
    enable = true;
    package = pkgs.rofi-wayland;
  };

  home.packages = with pkgs; [
    anki-bin
    audacity
    gimp
    ibm-plex
    kdePackages.kdenlive
    libnotify
    libreoffice
    logiops
    picard
    protonmail-bridge
    (pkgs.python3.withPackages (python-pkgs: [
      python-pkgs.python-lsp-server
      python-pkgs.python-lsp-ruff
    ]))
    runelite
    thunderbird
    vcv-rack
    waybar
    waybar-mpris
  ];
  services.arrpc.enable = true;

  services.emacs = {
    enable = true;
    client = {
      enable = true;
      arguments = [
        "-c"
        "-a ''"
        "-n"
      ];
    };
    defaultEditor = true;
  };

  services.mako = {
    enable = true;
    settings = {
      actions = true;
      anchor = "top-right";
      background-color = "#1e1e2e";
      border-color = "#cba6f7";
      border-radius = 0;
      default-timeout = 0;
      font = "monospace 10";
      height = 100;
      width = 300;
      icons = true;
      ignore-timeout = false;
      layer = "top";
      margin = 10;
      markup = true;

      # Section example
      "actionable=true" = {
        anchor = "top-left";
      };
    };
  };

  services.mpd = {
    enable = true;
    extraConfig = ''
       audio_output {
         type "pipewire"
      name "Pipewire Output"
          }
    '';
    musicDirectory = "/mnt/share/media/music";
  };

  services.mpd-discord-rpc = {
    enable = true;
    settings = {
      hosts = ["localhost:6600"];
      format = {
        details = "$track - $title [$duration]";
        state = "$artist / $album ($date)";
        timestamp = "elapsed";
      };
    };
  };

  services.mpd-mpris = {
    enable = true;
    mpd.useLocal = true;
  };
}
