rework layout

This commit is contained in:
Jonas Rabenstein 2025-09-20 13:34:01 +02:00
commit c642cf6c9c
8 changed files with 260 additions and 201 deletions

View file

@ -7,9 +7,9 @@
let
cfg = config.services.jellyfin;
plugin = name: pks."jellyfin-plugin-${name}";
plugin = name: pkgs."jellyfin-plugin-${name}";
per-file = pkg: fn: lib.lists.foldl (acc: dll: acc ++ (fn dll)) pkg.pluginLibraries;
per-file = pkg: fn: lib.lists.foldl (acc: dll: acc ++ lib.toList (fn dll)) [] pkg.pluginLibraries;
serviceConfig =
pkg:
@ -23,11 +23,11 @@ let
in
{
BindReadOnlyPaths = per-file pkg (
name: "${pkg}/${name}:${cfg.dataDir}/plugins/${pkg.name}/${name}"
);
BindPaths = per-file pkg (
name: lib.optional (rw name) "${cfg.dataDir}/plugins/${pkg.name}/${name}"
name: "${pkg}/${name}.dll:${cfg.dataDir}/plugins/${pkg.name}/${name}.dll"
);
BindPaths = [
"${cfg.dataDir}/plugins/${pkg.name}/meta.json"
];
};
type.plugin = lib.types.addCheck lib.types.package (builtins.hasAttr "pluginLibraries");
@ -35,7 +35,7 @@ in
{
options.services.jellyfin.plugins = lib.mkOption {
type = lib.types.listOf (lib.types.coercedTo lib.types.nonEmptyStr plugin type.plugin);
default = { };
default = [];
};
config.systemd = lib.mkIf (cfg.plugins != { }) {
@ -51,11 +51,11 @@ in
acc: pkg:
acc
// {
${pkg.name}."${cfg.dataDir}/plugins/${pkgs.name}/${name}".C = {
${pkg.name}."${cfg.dataDir}/plugins/${pkgs.name}/meta.json".C = {
group = cfg.group;
user = cfg.user;
mode = "0700";
argument = "${pkg}/${name}";
argument = "${pkg}/meta.json";
};
}
) { } cfg.plugins;