fixed shit
Some checks failed
Run tests / run_tests (push) Failing after 3s

This commit is contained in:
Snorre Ettrup Altschul 2025-04-04 00:53:14 +02:00
parent 0696a90d23
commit 33a30b1d2a
4 changed files with 44 additions and 47 deletions

View file

@ -1,10 +1,12 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: }:
with lib; let with lib; let
cfg = config.services.declarative-jellyfin; cfg = config.services.declarative-jellyfin;
toXml' = (import ../lib {nixpkgs = pkgs;}).toXMLGeneric;
isStrList = x: builtins.all (x: builtins.isString x) x; isStrList = x: builtins.all (x: builtins.isString x) x;
prepass = x: prepass = x:
if (builtins.isAttrs x) if (builtins.isAttrs x)
@ -45,6 +47,9 @@ with lib; let
content = prepass x; content = prepass x;
}); });
in { in {
imports = [
./options
];
config = config =
mkIf cfg.enable mkIf cfg.enable
{ {
@ -63,11 +68,11 @@ in {
file = "network.xml"; file = "network.xml";
content = cfg.network; content = cfg.network;
} }
{ # {
name = "EncodingOptions"; # name = "EncodingOptions";
file = "encoding.xml"; # file = "encoding.xml";
content = cfg.encoding; # content = cfg.encoding;
} # }
{ {
name = "ServerConfiguration"; name = "ServerConfiguration";
file = "system.xml"; file = "system.xml";

View file

@ -1,13 +1,8 @@
{ {
config,
pkgs,
lib, lib,
... ...
}: let }:
cfg = config.services.declarative-jellyfin; with lib; {
toXml' = (import ../../lib {nixpkgs = pkgs;}).toXMLGeneric;
in
with lib; {
imports = [ imports = [
./system.nix ./system.nix
./encoding.nix ./encoding.nix
@ -17,4 +12,4 @@ in
options.services.declarative-jellyfin = { options.services.declarative-jellyfin = {
enable = mkEnableOption "Jellyfin Service"; enable = mkEnableOption "Jellyfin Service";
}; };
} }

View file

@ -4,7 +4,7 @@
... ...
}: }:
with lib; let with lib; let
mkStrOption = default: description: { mkStrOption = default: description: mkOption {
type = types.str; type = types.str;
inherit default description; inherit default description;
}; };
@ -335,20 +335,20 @@ in {
default = true; default = true;
}; };
SlowResponseThresholdMs = { SlowResponseThresholdMs = mkOption {
type = types.int; type = types.int;
default = 500; default = 500;
description = "How slow (in ms) would a response have to be before a warning is shown"; description = "How slow (in ms) would a response have to be before a warning is shown";
}; };
CorsHosts = { CorsHosts = mkOption {
type = with types; listOf str; type = with types; listOf str;
default = [ default = [
"*" "*"
]; ];
}; };
ActivityLogRetentionDays = { ActivityLogRetentionDays = mkOption {
type = types.int; type = types.int;
default = 30; default = 30;
}; };
@ -410,7 +410,7 @@ in {
ParallelImageEncodingLimit = mkOption { ParallelImageEncodingLimit = mkOption {
type = types.int; type = types.int;
default = 0; default = 0;
descriptio = '' description = ''
Maximum number of image encodings that are allowed to run in parallel. Maximum number of image encodings that are allowed to run in parallel.
Setting this to 0 will choose a limit based on your systems core count. Setting this to 0 will choose a limit based on your systems core count.
''; '';

View file

@ -14,26 +14,23 @@ in {
../modules/default.nix ../modules/default.nix
]; ];
# assertions = let assertions = let
# toXml = (import ../lib {nixpkgs = pkgs;}).toXMLGeneric; toXml = (import ../lib {nixpkgs = pkgs;}).toXMLGeneric;
# in [ in [
# { (
# assertion = let
# toXml {tag = "test";} xml =
# == '' toXml {tag = "test";};
# <?xml version='1.0' encoding='utf-8'?> expected = ''
# <test /> <?xml version='1.0' encoding='utf-8'?>
# <test />
# ''; '';
# message = "Generated XML is incorrect!"; in {
# } assertion = xml == expected;
# { message = "Generated XML is incorrect!\nExpected \n\n${expected}\n\n but got \n\n${xml}\n";
# assertion = false; }
# message = "lmao"; )
# } ];
# ];
ass = false;
virtualisation.memorySize = 1024 * 2; virtualisation.memorySize = 1024 * 2;