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

View file

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

View file

@ -4,7 +4,7 @@
...
}:
with lib; let
mkStrOption = default: description: {
mkStrOption = default: description: mkOption {
type = types.str;
inherit default description;
};
@ -335,20 +335,20 @@ in {
default = true;
};
SlowResponseThresholdMs = {
SlowResponseThresholdMs = mkOption {
type = types.int;
default = 500;
description = "How slow (in ms) would a response have to be before a warning is shown";
};
CorsHosts = {
CorsHosts = mkOption {
type = with types; listOf str;
default = [
"*"
];
};
ActivityLogRetentionDays = {
ActivityLogRetentionDays = mkOption {
type = types.int;
default = 30;
};
@ -410,7 +410,7 @@ in {
ParallelImageEncodingLimit = mkOption {
type = types.int;
default = 0;
descriptio = ''
description = ''
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.
'';

View file

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