{ pkgs, ... }:
let
  shellAliases = {
    update-boot = "sudo nixos-rebuild boot --max-jobs 10 --build-host admin@10.0.1.3";
    update-switch = "sudo nixos-rebuild switch --max-jobs 10";
    update-flake = "nix flake update steamdeck-nixpkgs steamdeck-chaotic steamdeck-home-manager steamdeck-impermanence steamdeck-jovian steamdeck-lanzaboote steamdeck-nixos-hardware steamdeck-sops-nix steamdeck-steam-rom-manager --flake /etc/nixos";
    nas-ssh = "ssh admin@10.0.1.3";
  };
in
{
  home.username = "deck";

  mjallen.desktop.gnome.enable = true;

  sops = {
    age.keyFile = "/home/deck/.config/sops/age/keys.txt";
    defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
    validateSopsFiles = false;
    secrets = {
      "ssh-keys-public/deck" = {
        path = "/home/deck/.ssh/id_ed25519.pub";
        mode = "0644";
      };
      "ssh-keys-private/deck" = {
        path = "/home/deck/.ssh/id_ed25519";
        mode = "0600";
      };
    };
  };

  programs = {
    steam-rom-manager = {
      enable = true;
      steamUsername = "mjallen18";

      # Optional: override default paths if needed
      environmentVariables = {
        romsDirectory = "/home/deck/Emulation/roms";
        steamDirectory = "/home/deck/.local/share/Steam";
      };

      emulators = {
        ryujinx.enable = true;

        dolphin-gamecube = {
          enable = true;
          package = pkgs.dolphin-emu;
          romFolder = "gc";
          fileTypes = [
            ".iso"
            ".ISO"
            ".gcm"
            ".GCM"
            ".ciso"
            ".CISO"
            "rvz"
          ];
          extraArgs = "-b -e \"\${filePath}\"";
        };

        pcsx2.enable = true;
        mgba.enable = true;

        "Non-SRM Shortcuts" = {
          enable = true;
          parserType = "Non-SRM Shortcuts";
          extraArgs = "";
        };
      };
    };

    zsh.shellAliases = shellAliases;
  };

  home.packages = with pkgs; [
    dolphin-emu
    heroic
    mgba
    prismlauncher
    ryujinx-greemdev
    omnissa-horizon-client
  ];
}
