{
  config,
  lib,
  pkgs,
  ...
}:

{
  imports = [ ];

  options.me = {
    yuzu.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      example = true;
      description = "Whether we want to install yuzu.";
    };
  };

  config = lib.mkIf config.me.yuzu.enable (
    lib.mkMerge [
      (lib.mkIf config.me.graphical {
        home.file.".config/yuzu/qt-config.ini" = {
          source = ./files/qt-config.ini;
        };
        home.file.".config/yuzu/input/deck.ini" = {
          source = ./files/deck.ini;
        };

        me.persist.directories = [
          ".local/share/yuzu/nand"
          ".local/share/yuzu/sdmc" # SD Card
          ".local/share/yuzu/screenshots"
          ".local/share/yuzu/keys"
          ".config/yuzu/custom" # Per-game configs
        ];
        me.state.directories = [ ".local/share/yuzu/shader" ];
      })
    ]
  );
}
