{pkgs, ...}: { home-manager.users.toast = { home = { packages = [ ( pkgs.wrapRetroArch { cores = with pkgs.libretro; [ snes9x ]; settings = { video_driver = "vulkan"; video_fullscreen = "true"; menu_swap_ok_cancel_buttons = "true"; input_joypad_driver = "sdl2"; # Enable touchscreen support menu_pointer_enable = "true"; # Folder stuffs # System/BIOS files system_directory = "~/.local/share/retroarch/system"; # Downloads core_assets_directory = "~/.local/share/retroarch/downloads"; thumbnails_directory = "~/.local/share/retroarch/thumbnails"; content_database_path = "~/.local/share/retroarch/database/rdb"; cheat_database_path = "~/.local/share/retroarch/cheats"; video_filter_dir = "~/.local/share/retroarch/filters/video"; audio_filter_dir = "~/.local/share/retroarch/filters/audio"; video_shader_dir = "~/.local/share/retroarch/shaders"; recording_output_directory = "~/.local/share/retroarch/records"; overlay_directory = "~/.local/share/retroarch/overlays"; osk_overlay_directory = "~/.local/share/retroarch/overlays/keyboards"; screenshot_directory = "~/.local/share/retroarch/screenshots"; playlist_directory = "~/.local/share/retroarch/playlists"; savefile_directory = "~/.local/share/retroarch/saves"; savestate_directory = "~/.local/share/retroarch/states"; log_dir = "~/.local/share/retroarch/logs"; # By default settings has some things that this overrides, so I need to set them myself libretro_info_path = "${pkgs.libretro-core-info}/share/retroarch/cores"; joypad_autoconfig_dir = "${pkgs.retroarch-joypad-autoconfig}/share/libretro/autoconfig"; assets_directory = "${pkgs.retroarch-assets}/share/retroarch/assets"; }; } ) ]; }; # Retroarch is dumb since it doesn't generate some folders (but it does for others) systemd.user.tmpfiles.rules = [ "d /%h/.local/share/retroarch/playlists" "d /%h/.local/share/retroarch/saves" "d /%h/.local/share/retroarch/states" ]; systemd.user.paths = { snes-roms = { Unit.Description = "Monitor SNES rom path for changes"; Path = { PathChanged = "/%h/Games/SNES"; Unit = "update-retroarch-library.service"; }; Install.WantedBy = ["default.target"]; }; }; systemd.user.services.update-retroarch-library = { Service = { Type = "oneshot"; ExecStart = pkgs.writeShellScript "scan-snes-games" '' ${pkgs.libnotify}/bin/notify-send -a RetroArch \ -i retroarch \ "SNES games changed!" \ "Scanning $TRIGGER_PATH..." ${pkgs.retroarch}/bin/retroarch --scan "/home/toast/Games/SNES" ''; }; }; }; # Sync saves and some other stuff services.syncthing.settings.folders = { "retroarch" = { label = "RetroArch"; id = "jxuou-2yjnu"; devices = ["steamdeck" "server" "pc" "winmax2"]; path = "~/.local/share/retroarch"; }; }; }