2022-02-10 20:34:41 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.services.xserver.desktopManager.retroarch;
|
|
|
|
|
|
|
|
in {
|
|
|
|
options.services.xserver.desktopManager.retroarch = {
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "RetroArch");
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "retroarch" {
|
|
|
|
example = "retroarch-full";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraArgs = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ ];
|
|
|
|
example = [ "--verbose" "--host" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "Extra arguments to pass to RetroArch.";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.xserver.desktopManager.session = [{
|
|
|
|
name = "RetroArch";
|
|
|
|
start = ''
|
|
|
|
${cfg.package}/bin/retroarch -f ${escapeShellArgs cfg.extraArgs} &
|
|
|
|
waitPID=$!
|
|
|
|
'';
|
|
|
|
}];
|
|
|
|
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
};
|
|
|
|
|
|
|
|
meta.maintainers = with maintainers; [ j0hax ];
|
|
|
|
}
|