{
  self,
  pkgs,
  clipboard-sync,
  ...
}:

{
  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

  home.file = {
    # My utility scripts
    ".local/share/scripts" = {
      source = ./scripts;
      recursive = true;
    };

    # Configuration for mako, a notification daemon.
    ".config/mako".source = ./dotfiles/mako;

    # Configure pipewire for microphone noise supression.
    ".config/pipewire/pipewire.conf.d/99-input-denoising.conf".text = ''
      context.modules = [
        { name = libpipewire-module-filter-chain
          args = {
            node.description =  "Noise Canceling source"
            media.name =  "Noise Canceling source"
            filter.graph = {
              nodes = [
                {
                  type = ladspa
                  name = rnnoise
                  plugin = ${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so
                  label = noise_suppressor_mono
                  control = {
                    "VAD Threshold (%)" = 60.0
                    "VAD Grace Period (ms)" = 175
                    "Retroactive VAD Grace (ms)" = 50
                  }
                }
              ]
            }
            capture.props = {
              node.name =  "capture.rnnoise_source"
              node.passive = true
              audio.rate = 48000
            }
            playback.props = {
              node.name =  "rnnoise_source"
              media.class = Audio/Source
              audio.rate = 48000
            }
          }
        }
      ]
    '';
  };

  # Configure XDG
  xdg.mimeApps.defaultApplications = {
    "inode/directory" = [ "thunar.desktop" ];
    "text/html" = [ "firefox.desktop" ];
    "text/plain" = [ "nvim.desktop" ];
    "video/mp4" = [ "vlc.desktop" ];
    "video/x-matroska" = [ "vlc.desktop" ];
    "x-scheme-handler/about" = [ "firefox.desktop" ];
    "x-scheme-handler/http" = [ "firefox.desktop" ];
    "x-scheme-handler/https" = [ "firefox.desktop" ];
    "x-scheme-handler/unknown" = [ "firefox.desktop" ];
  };

  home.packages = with pkgs; [
    # # You can also create simple shell scripts directly inside your
    # # configuration. For example, this adds a command 'my-hello' to your
    # # environment:
    # (pkgs.writeShellScriptBin "my-hello" ''
    #   echo "Hello, ${config.home.username}!"
    # '')

    ## Tools
    # Utilities
    fastfetch
    firefox
    pavucontrol
    protonvpn-gui # WARNING: Marked as broken https://github.com/NixOS/nixpkgs/commit/84faa614a5256a84e3dd4e445053ff76f4c0a5d4
    qbittorrent
    qdirstat
    speedcrunch
    vlc
    yt-dlp
    zathura

    # Personal utilities
    anki
    ledger
    vesktop

    # Editing
    libreoffice

    # Creative work
    aseprite
    blender
    krita
    # self.packages.${system}.lmms # FIXME: Broken for now, gotta update the package
    orca-slicer
    shotcut
    vcv-rack
    vhs

    ## Entertainment
    #jellyfin-media-player # FIXME: Unsafe dependency: https://github.com/NixOS/nixpkgs/issues/437865

    ## Libraries
    kdePackages.kdegraphics-thumbnailers
    kdePackages.kio-extras
    rnnoise-plugin

    ## Development
    dbeaver-bin
    godot_4
    hoppscotch
    lazygit

    ## Desktop environment
    clipboard-sync.packages.${pkgs.stdenv.hostPlatform.system}.default
    cliphist
    grim
    kdePackages.ark
    loupe
    mako
    slurp
    swww

    # Mail client
    thunderbird
  ];
}
