Home Explore Blog Models CI



nixpkgs

pkgs/applications/emulators/libretro/README.md
e934691e7ab3439b5bad21a56d3d41af9b2e767afd0726500000000300000366
# Libretro

[libretro cores](https://docs.libretro.com/guides/core-list/) and related
packages.

## Adding new cores

The basic steps to add a new core are:

1. Add a new core using `mkLibretroCore` function (use one of the existing
   cores as an example)
2. Add your new core to [`default.nix`](./default.nix) file
3. Try to build your core with `nix-build -A libretro.<core>`

## Using RetroArch with cores

To create a custom RetroArch derivation with the cores you want (instead of
using `retroarch-full` that includes all cores), you can use `.withCores` like
this:

```nix
{ pkgs, ... }:

let
  retroarchWithCores = (
    pkgs.retroarch.withCores (
      cores: with cores; [
        bsnes
        mgba
        quicknes
      ]
    )
  );
in
{
  environment.systemPackages = [ retroarchWithCores ];
}
```

For advanced customization, see `wrapRetroArch` wrapper.

Chunks
bb9e10b0 (1st chunk of `pkgs/applications/emulators/libretro/README.md`)
Title: Libretro Cores and RetroArch Configuration
Summary
This document describes how to manage Libretro cores, including the process for adding new ones using `mkLibretroCore` and updating `default.nix`. It also explains how to create a custom RetroArch derivation that includes only a specified set of cores using the `.withCores` function, as an alternative to the `retroarch-full` package.