From 9f8994f4d2cb1aa4f6e41e8378099dabd21c13cc Mon Sep 17 00:00:00 2001 From: sinavir Date: Wed, 17 Jan 2024 13:37:12 +0100 Subject: [PATCH] add themes --- games.nix | 10 +++++++++- modules/es-config.nix | 13 ++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/games.nix b/games.nix index 86b99ac..02b7b55 100644 --- a/games.nix +++ b/games.nix @@ -9,7 +9,7 @@ in { retronix = { systems = { - "Arcade" = { + "arcade" = { extension = ".sh"; games = with pkgs.roms; mapRetroarchConfig {} [ atetris @@ -24,6 +24,14 @@ in emulationstation = { inputCfgFile = mkFile "es_input.cfg" ./es_input.cfg; settingsCfgFile = mkFile "es_settings.cfg" ./es_settings.cfg; + themes = { + "ComicBook" = pkgs.fetchFromGitHub { + owner = "TMNTturtleguy"; + repo = "es-theme-ComicBook"; + rev = "master"; + hash = "sha256-Mma7/5osIvTdTM8Z0vkJBW/4p3O6wms6nBApxB7+IiA="; + }; + }; }; }; } diff --git a/modules/es-config.nix b/modules/es-config.nix index 7086e0e..9ab9907 100644 --- a/modules/es-config.nix +++ b/modules/es-config.nix @@ -61,7 +61,7 @@ let symlinkCommands = builtins.map ( v: "ln -s ${v}/${v.launchPath} $out/${v.name}.sh" ) games; - + in pkgs.runCommand "${name}-roms" { inherit gamelist symlinkCommands; passAsFile = [ @@ -121,6 +121,10 @@ in { themesDir = lib.mkOption { type = lib.types.path; }; + themes = lib.mkOption { + type = lib.types.attrsOf lib.types.path; + default = {}; + }; inputCfg = lib.mkOption { type = lib.types.str; default = ""; @@ -157,6 +161,12 @@ in { ''; inputCfgFile = lib.mkDefault (pkgs.writeTextDir "es_input.cfg" cfg.inputCfg); + themesDir = let + copyCommands = lib.concatLines (lib.mapAttrsToList (k: v: "cp -r ${v} $out/themes/${k}") cfg.themes); + in pkgs.runCommand "es-themes" {} '' + mkdir -p $out/themes + ${copyCommands} + ''; homeDir = pkgs.symlinkJoinSubdir { name = "es-config-dir"; subdir = ".emulationstation"; @@ -164,6 +174,7 @@ in { cfg.systemCfgFile cfg.inputCfgFile cfg.settingsCfgFile + cfg.themesDir ] ++ cfg.extraConfigFiles; }; cli = pkgs.writeScript "emulationstation" "${pkgs.emulationstationPatched}/bin/emulationstation --home ${cfg.homeDir} --gamelist-only";