This commit is contained in:
mjallen18
2025-02-19 16:56:13 -06:00
parent 3c636cb507
commit debc590187
4 changed files with 98 additions and 11 deletions

View File

@@ -179,11 +179,41 @@ let
in
makeOrderedJSON orderedConfig;
# Create AppImage package
steam-rom-manager = pkgs.fetchurl {
name = "steam-rom-manager-2.5.29.AppImage";
url = "https://github.com/SteamGridDB/steam-rom-manager/releases/download/v2.5.29/Steam-ROM-Manager-2.5.29.AppImage";
hash = "sha256-6ZJ+MGIgr2osuQuqD6N9NnPiJFNq/HW6ivG8tyXUhvs=";
# Fetch the SVG icon file directly
steam-rom-manager-icon = pkgs.fetchurl {
name = "steam-rom-manager.svg";
url = "https://raw.githubusercontent.com/SteamGridDB/steam-rom-manager/master/src/assets/icons/steam-rom-manager.svg";
hash = "sha256-DKzNIs5UhIWAVRTfinvCb8WqeDniPWw9Z08/p/Zpa9E=";
};
# Create our Steam ROM Manager package
steam-rom-manager = pkgs.stdenv.mkDerivation {
name = "steam-rom-manager-2.5.29";
src = pkgs.fetchurl {
name = "steam-rom-manager-2.5.29.AppImage";
url = "https://github.com/SteamGridDB/steam-rom-manager/releases/download/v2.5.29/Steam-ROM-Manager-2.5.29.AppImage";
hash = "sha256-6ZJ+MGIgr2osuQuqD6N9NnPiJFNq/HW6ivG8tyXUhvs=";
};
nativeBuildInputs = [ pkgs.makeWrapper ];
# Skip unnecessary build phases since we're just installing files
dontUnpack = true;
dontBuild = true;
dontPatch = true;
dontConfigure = true;
installPhase = ''
# Create our directory structure
mkdir -p $out/{bin,share/icons/hicolor/scalable/apps,share/applications}
# Install the AppImage
cp $src $out/bin/steam-rom-manager.AppImage
chmod +x $out/bin/steam-rom-manager.AppImage
# Install the SVG icon
cp ${steam-rom-manager-icon} $out/share/icons/hicolor/scalable/apps/steam-rom-manager.svg
'';
};
in {
options.programs.steam-rom-manager = {
@@ -252,12 +282,27 @@ in {
home.packages = [ pkgs.appimage-run ]
++ mapAttrsToList (_: v: v.package) (filterAttrs (_: v: v.enable) cfg.emulators);
# Install the icon
xdg.dataFile = {
"icons/hicolor/scalable/apps/steam-rom-manager.svg".source = steam-rom-manager-icon;
};
# Create the desktop entry
xdg.desktopEntries.steam-rom-manager = {
name = "Steam ROM Manager";
exec = "${pkgs.appimage-run}/bin/appimage-run ${cfg.package}";
icon = "steam";
exec = "${pkgs.appimage-run}/bin/appimage-run ${steam-rom-manager}/bin/steam-rom-manager.AppImage";
icon = "steam-rom-manager";
categories = [ "Game" "Utility" ];
type = "Application";
terminal = false;
comment = "Add ROMs to Steam with artwork";
# Add KDE-specific entries
settings = {
# Ensure it appears in Plasma menus
"X-KDE-StartupNotify" = "true";
"X-KDE-SubstituteUID" = "false";
"X-DBUS-StartupType" = "Unique";
};
};
# Configuration files using xdg.configFile