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 = {
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = mkEnableOption "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" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "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 ];
|
|
|
|
}
|