diff --git a/modules/services/jellyfin/default.nix b/modules/services/jellyfin/default.nix
index f662724..b73cae9 100644
--- a/modules/services/jellyfin/default.nix
+++ b/modules/services/jellyfin/default.nix
@@ -6,8 +6,15 @@ let
port = 8096;
# enable monitoring
jellyfin-with-metrics = pkgs.jellyfin.overrideAttrs (attrs: {
- # with this patch the default setting for metrics is changed
- patches = attrs.patches ++ [ ./enable-metrics.patch ];
+ patches =
+ let
+ existingPatches =
+ if attrs ? patches && builtins.isList attrs.patches
+ then attrs.patches
+ else [ ];
+ in
+ # with this patch the default setting for metrics is changed
+ existingPatches ++ [ ./enable-metrics.patch ];
});
in
{
diff --git a/modules/services/jellyfin/enable-metrics.patch b/modules/services/jellyfin/enable-metrics.patch
index 1544512..3251cf5 100644
--- a/modules/services/jellyfin/enable-metrics.patch
+++ b/modules/services/jellyfin/enable-metrics.patch
@@ -1,13 +1,13 @@
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
-index 07f02d1879..0f1c2e0cb8 100644
+index 52f7e53b81..b149e3251a 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
-@@ -66,7 +66,7 @@ namespace MediaBrowser.Model.Configuration
- ///
- /// Gets or sets a value indicating whether to enable prometheus metrics exporting.
- ///
-- public bool EnableMetrics { get; set; } = false;
-+ public bool EnableMetrics { get; set; } = true;
+@@ -67,7 +67,7 @@ public class ServerConfiguration : BaseApplicationConfiguration
+ ///
+ /// Gets or sets a value indicating whether to enable prometheus metrics exporting.
+ ///
+- public bool EnableMetrics { get; set; } = false;
++ public bool EnableMetrics { get; set; } = true;
- public bool EnableNormalizedItemByNameIds { get; set; } = true;
+ public bool EnableNormalizedItemByNameIds { get; set; } = true;