{
  config,
  lib,
  namespace,
  ...
}:
with lib;
let
  name = "jellyfin";
  cfg = config.${namespace}.services.${name};

  jellyfinConfig = lib.${namespace}.mkModule {
    inherit config name;
    description = "jellyfin";
    options = { };
    moduleConfig = {
      services.jellyfin = {
        enable = true;
        openFirewall = cfg.openFirewall;
        user = "nix-apps";
        group = "jallen-nas";
        dataDir = "${cfg.configDir}/jellyfin";
        # cacheDir = "/cache";
      };
    };
  };
in
{
  imports = [ jellyfinConfig ];
}
