nixos/programs/retroarch: init

This commit is contained in:
Gabriel Arazas 2024-11-19 19:09:22 +08:00
parent 4617721161
commit 8c346a81fa
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 52 additions and 0 deletions

View File

@ -4,6 +4,7 @@
./programs/distrobox.nix ./programs/distrobox.nix
./programs/gnome-session ./programs/gnome-session
./programs/pop-launcher.nix ./programs/pop-launcher.nix
./programs/retroarch.nix
./programs/sessiond ./programs/sessiond
./programs/wezterm.nix ./programs/wezterm.nix
./services/archivebox.nix ./services/archivebox.nix

View File

@ -0,0 +1,51 @@
{ config, lib, pkgs, ... }:
let
cfg = config.programs.retroarch;
finalPkg = cfg.package.override {
inherit (cfg) cores settings;
};
in
{
options.programs.retroarch = {
enable = lib.mkEnableOption "configuring Retroarch";
package = lib.mkPackageOption pkgs "retroarch" { };
cores = lib.mkOption {
type = with lib.types; listOf package;
default = [ ];
description = ''
List of Retroarch cores to be included with the package.
'';
example = lib.literalExpression ''
with pkgs.libretro; [
ppsspp
desmume
pcsx2
]
'';
};
settings = lib.mkOption {
type = with lib.types; attrsOf anything;
default = { };
description = ''
Additional settings to be configured with the Retroarch nixpkgs
wrapper.
'';
example = lib.literalExpression ''
{
assets_directory = "''${pkgs.retroarch-assets}/share/retroarch-assets";
joypad_autoconfig_dir = "''${pkgs.retroarch-joypad-autoconfig}/share/libretro/autoconfig";
libretro_info_path = "''${pkgs.libretro-core-info}/share/retroarch/cores";
}
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ finalPkg ];
};
}