feat(zeus): add RetroArch
This commit was merged in pull request #203.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
modules.desktop.enable = true;
|
||||
modules.desktop.apps.obsidian.enable = true;
|
||||
modules.desktop.apps.r2modman.enable = true;
|
||||
modules.desktop.emulation.enable = true;
|
||||
modules.desktop.apps.signal.enable = true;
|
||||
modules.desktop.apps.steam.enable = true;
|
||||
modules.desktop.apps.vencord.enable = true;
|
||||
|
||||
36
configs/nixos/modules/desktop/emulation.nix
Normal file
36
configs/nixos/modules/desktop/emulation.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
# Shared directories for emulators.
|
||||
let
|
||||
user = config.user.name;
|
||||
directory = "/home/${user}/emulation";
|
||||
in
|
||||
{
|
||||
options.modules.desktop.emulation.enable = lib.mkEnableOption "shared emulation directories";
|
||||
|
||||
config = lib.mkIf config.modules.desktop.emulation.enable {
|
||||
modules.desktop.emulation.retroarch = {
|
||||
enable = lib.mkDefault true;
|
||||
browserDirectory = "${directory}/roms";
|
||||
};
|
||||
|
||||
home-manager.users.${user} = hm: {
|
||||
home.file = {
|
||||
".config/retroarch/saves".source = hm.config.lib.file.mkOutOfStoreSymlink "${directory}/saves";
|
||||
".config/retroarch/states".source = hm.config.lib.file.mkOutOfStoreSymlink "${directory}/states";
|
||||
".config/retroarch/system".source = hm.config.lib.file.mkOutOfStoreSymlink "${directory}/bios";
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.rules = map (path: "d ${path} 0700 - - -") [
|
||||
directory
|
||||
"${directory}/bios"
|
||||
"${directory}/roms"
|
||||
"${directory}/saves"
|
||||
"${directory}/states"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
62
configs/nixos/modules/desktop/emulation/retroarch.nix
Normal file
62
configs/nixos/modules/desktop/emulation/retroarch.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
util,
|
||||
...
|
||||
}:
|
||||
# RetroArch with the selected PlayStation and Sega Saturn cores.
|
||||
let
|
||||
cfg = config.modules.desktop.emulation.retroarch;
|
||||
user = config.user.name;
|
||||
in
|
||||
{
|
||||
options.modules.desktop.emulation.retroarch = {
|
||||
enable = lib.mkEnableOption "RetroArch with PlayStation and Sega Saturn cores";
|
||||
|
||||
browserDirectory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Directory where RetroArch starts its content browser.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home-manager.users.${user} = {
|
||||
home.packages = [
|
||||
(pkgs.wrapRetroArch {
|
||||
cores = with pkgs.libretro; [
|
||||
beetle-psx-hw
|
||||
beetle-saturn
|
||||
];
|
||||
settings = {
|
||||
savefiles_in_content_dir = "false";
|
||||
savestates_in_content_dir = "false";
|
||||
system_directory = "/home/${user}/.config/retroarch/system";
|
||||
video_fullscreen = "true";
|
||||
sort_savefiles_enable = "true";
|
||||
sort_savestates_enable = "true";
|
||||
cloud_sync_enable = "true";
|
||||
cloud_sync_driver = "webdav";
|
||||
webdav_url = "https://games.alexion.dev/api/sync/retroarch/";
|
||||
cloud_sync_sync_saves = "true";
|
||||
cloud_sync_sync_configs = "true";
|
||||
cloud_sync_sync_thumbs = "false";
|
||||
cloud_sync_sync_system = "false";
|
||||
cloud_sync_sync_mode = "0";
|
||||
cloud_sync_destructive = "false";
|
||||
}
|
||||
// lib.optionalAttrs (cfg.browserDirectory != "") {
|
||||
rgui_browser_directory = cfg.browserDirectory;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
registry.window-icon.${config.networking.hostName}.retroarch = {
|
||||
class = "com.libretro.RetroArch";
|
||||
icon = util.glyph "f11b";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user