feat(romm): package version 5.4.0

This commit is contained in:
2026-10-20 23:31:15 -04:00
parent cfa01fb550
commit 1c1420b8c0
3 changed files with 70 additions and 0 deletions

View File

@@ -1,10 +1,18 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.modules.services.romm;
rommConfig = (pkgs.formats.yaml { }).generate "romm-config.yml" {
emulatorjs.auto_save_sync = false;
filesystem.structure = {
default = "roms/{platform}/{game}";
firmware = "bios/{platform}";
};
};
in
{
options.modules.services.romm = {
@@ -31,13 +39,19 @@ in
services.romm = {
enable = true;
package = pkgs.alexion.romm;
group = "storage";
database.createLocally = true;
redis.createLocally = true;
watcher.enable = true;
extraEnvironment.ROM_CONVERTO_ENABLED = "false";
inherit (cfg) environmentFile;
};
systemd.tmpfiles.settings."10-romm"."${config.services.romm.dataDir}/config/config.yml"."L+" = {
argument = toString rommConfig;
};
users.users = {
romm.uid = config.registry."stable-uid".${config.networking.hostName}.romm;
redis-romm.uid = config.registry."stable-uid".${config.networking.hostName}."redis-romm";

View File

@@ -4,5 +4,7 @@
inherit root;
};
romm = pkgs.callPackage ./romm.nix { };
waybar = pkgs.callPackage ./waybar.nix { };
}

View File

@@ -0,0 +1,54 @@
{
buildNpmPackage,
fetchFromGitHub,
lib,
romm,
}:
romm.overrideAttrs (
finalAttrs: previousAttrs:
let
frontend = buildNpmPackage {
pname = "romm-frontend";
inherit (finalAttrs) version;
src = "${finalAttrs.src}/frontend";
npmDepsHash = "sha256-f5IcpOVv7JYFzUPkZIq5nbT3dS1f/KCSllh8Vkgl1P0=";
npmFlags = [ "--ignore-scripts" ];
makeCacheWritable = true;
installPhase = ''
runHook preInstall
cp -r dist $out
chmod u+w $out/assets
cp -r assets/. $out/assets/
runHook postInstall
'';
};
in
{
version = "5.4.0";
src = fetchFromGitHub {
owner = "rommapp";
repo = "romm";
tag = finalAttrs.version;
hash = "sha256-oIYEdIAJgXkcqjZtWlWKD/NFiQ3gbo7gxwLhqZOCWpM=";
};
postPatch = previousAttrs.postPatch + ''
# Redis 8.0.1 removed this argument.
# RomM disables the related maintenance notifications.
substituteInPlace backend/handler/redis_handler.py \
--replace-fail 'from redis.maint_notifications import MaintNotificationsConfig' "" \
--replace-fail ' "maint_notifications_config": MaintNotificationsConfig(enabled=False),' ""
'';
installPhase =
lib.replaceStrings [ "${previousAttrs.passthru.frontend}" ] [ "${frontend}" ]
previousAttrs.installPhase;
passthru = previousAttrs.passthru // {
inherit frontend;
};
}
)