-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work to bring home-manager configuration to Lutris. Due to some limitation on how Lutris rewrites on runtime the .conf file, only the runners and the extra packages will be addressed in this patchset.
- Loading branch information
1 parent
83ecd50
commit a5e2f64
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
let | ||
cfg = config.programs.lutris; | ||
|
||
cemuConf = '' | ||
cemu: | ||
runner_executable: ${pkgs.cemu}/bin/cemu | ||
''; | ||
dolphinConf = '' | ||
dolphin: | ||
runner_executable: ${cfg.runners.dolphin.package}/bin/dolphin-emu | ||
''; | ||
duckstationConf = '' | ||
duckstation: | ||
runner_executable: ${pkgs.duckstation}/bin/duckstation-qt | ||
''; | ||
pcsx2Conf = '' | ||
pcsx2: | ||
runner_executable: ${pkgs.pcsx2}/bin/pcsx2-qt | ||
''; | ||
ppssppConf = '' | ||
ppsspp: | ||
runner_executable: ${cfg.runners.ppsspp.package}/bin/ppsspp | ||
''; | ||
rpcs3Conf = '' | ||
rpcs3: | ||
runner_executable: ${pkgs.rpcs3}/bin/rpcs3 | ||
''; | ||
|
||
in { | ||
meta.maintainers = [ maintainers.rapiteanu ]; | ||
|
||
options = { | ||
programs.lutris = { | ||
enable = mkEnableOption "Open Source gaming platform for GNU/Linux"; | ||
|
||
package = mkOption { | ||
type = types.package; | ||
default = pkgs.lutris; | ||
defaultText = literalExpression "pkgs.lutris"; | ||
description = "The Lutris package to use."; | ||
}; | ||
|
||
extraPackages = mkOption { | ||
type = with types; listOf package; | ||
default = [ ]; | ||
example = | ||
literalExpression "[ pkgs.wineWowPackages.staging pkgs.winetricks ]"; | ||
description = "Packages that should be available to Lutris."; | ||
}; | ||
|
||
runners = { | ||
cemu.enable = mkEnableOption "cemu"; | ||
|
||
dolphin = { | ||
enable = mkEnableOption "dolphin-emu"; | ||
package = mkOption { | ||
type = types.package; | ||
default = pkgs.dolphin-emu; | ||
defaultText = literalExpression "pkgs.dolphin-emu"; | ||
description = "The Lutris Dolphin Emulator package to use."; | ||
}; | ||
}; | ||
|
||
duckstation.enable = mkEnableOption "duckstation"; | ||
|
||
pcsx2.enable = mkEnableOption "pcsx2"; | ||
|
||
ppsspp = { | ||
enable = mkEnableOption "ppsspp"; | ||
package = mkOption { | ||
type = types.package; | ||
default = pkgs.ppsspp; | ||
defaultText = literalExpression "pkgs.ppsspp"; | ||
description = "The Lutris PPSSPP package to use."; | ||
}; | ||
}; | ||
|
||
rpcs3.enable = mkEnableOption "rpcs3"; | ||
}; | ||
|
||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
home.packages = | ||
[ (cfg.package.override { extraPkgs = pkgs: cfg.extraPackages; }) ] | ||
++ optional cfg.runners.cemu.enable pkgs.cemu | ||
++ optional cfg.runners.dolphin.enable cfg.runners.dolphin.package | ||
++ optional cfg.runners.duckstation.enable pkgs.duckstation | ||
++ optional cfg.runners.pcsx2.enable pkgs.pcsx2 | ||
++ optional cfg.runners.ppsspp.enable cfg.runners.ppsspp.package | ||
++ optional cfg.runners.rpcs3.enable pkgs.rpcs3; | ||
|
||
xdg.dataFile = { | ||
"lutris/runners/cemu.yml" = | ||
mkIf (cfg.runners.cemu.enable) { text = cemuConf; }; | ||
"lutris/runners/dolphin.yml" = | ||
mkIf (cfg.runners.dolphin.enable) { text = dolphinConf; }; | ||
"lutris/runners/duckstation.yml" = | ||
mkIf (cfg.runners.duckstation.enable) { text = duckstationConf; }; | ||
"lutris/runners/pcsx2.yml" = | ||
mkIf (cfg.runners.pcsx2.enable) { text = pcsx2Conf; }; | ||
"lutris/runners/ppsspp.yml" = | ||
mkIf (cfg.runners.ppsspp.enable) { text = ppssppConf; }; | ||
"lutris/runners/rpcs3.yml" = | ||
mkIf (cfg.runners.rpcs3.enable) { text = rpcs3Conf; }; | ||
}; | ||
}; | ||
} |