mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 16:57:55 +00:00
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
|
{ 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 ];
|
||
|
};
|
||
|
}
|