rework layout
This commit is contained in:
parent
4e2263c590
commit
68c510c807
8 changed files with 259 additions and 200 deletions
|
|
@ -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 ++ (fn dll)) [] pkg.pluginLibraries;
|
||||
|
||||
serviceConfig =
|
||||
pkg:
|
||||
|
|
@ -25,9 +25,9 @@ let
|
|||
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}"
|
||||
);
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue