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

let cfg = config.sydnix.slippi;
in {
  options.sydnix.slippi = {
    enable = lib.mkEnableOption "Slippi meleeeeee";
  };

  config = lib.mkIf cfg.enable {
    programs.appimage = {
      enable = true;
      binfmt = true;
    };

    services.udev = {
      enable = true;
      # Change the mode (as in chmod) of my third-party Wii U GameCube adapter
      # device to 666.
      extraRules = ''
        SUBSYSTEMS=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666"
      '';
    };
  };
}
