jellyfin: move function to create plugins into lib
This commit is contained in:
parent
f39865391e
commit
6ffa9127e2
2 changed files with 28 additions and 27 deletions
|
|
@ -383,4 +383,30 @@ rec {
|
||||||
map genLoadCredentials allSecrets;
|
map genLoadCredentials allSecrets;
|
||||||
|
|
||||||
anyNotNull = any (x: x != null);
|
anyNotNull = any (x: x != null);
|
||||||
|
|
||||||
|
mkJellyfinPlugin =
|
||||||
|
{
|
||||||
|
pname,
|
||||||
|
version,
|
||||||
|
hash,
|
||||||
|
url,
|
||||||
|
}:
|
||||||
|
pkgs.callPackage (
|
||||||
|
{ stdenv, fetchzip }:
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
inherit pname version;
|
||||||
|
|
||||||
|
src = fetchzip {
|
||||||
|
inherit url hash;
|
||||||
|
stripRoot = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r . $out
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
) { };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,31 +65,6 @@ let
|
||||||
in
|
in
|
||||||
"${meta.name}_${meta.version}";
|
"${meta.name}_${meta.version}";
|
||||||
|
|
||||||
mkJellyfinPlugin =
|
|
||||||
{
|
|
||||||
pname,
|
|
||||||
version,
|
|
||||||
hash,
|
|
||||||
url,
|
|
||||||
}:
|
|
||||||
pkgs.callPackage (
|
|
||||||
{ stdenv, fetchzip }:
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
|
||||||
inherit pname version;
|
|
||||||
|
|
||||||
src = fetchzip {
|
|
||||||
inherit url hash;
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir $out
|
|
||||||
cp -r . $out
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
) { };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.shb.jellyfin = {
|
options.shb.jellyfin = {
|
||||||
|
|
@ -177,7 +152,7 @@ in
|
||||||
plugin = lib.mkOption {
|
plugin = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
description = "Pluging used for LDAP authentication.";
|
description = "Pluging used for LDAP authentication.";
|
||||||
default = mkJellyfinPlugin (rec {
|
default = shb.mkJellyfinPlugin (rec {
|
||||||
pname = "jellyfin-plugin-ldapauth";
|
pname = "jellyfin-plugin-ldapauth";
|
||||||
version = "20";
|
version = "20";
|
||||||
url = "https://github.com/jellyfin/${pname}/releases/download/v${version}/ldap-authentication_${version}.0.0.0.zip";
|
url = "https://github.com/jellyfin/${pname}/releases/download/v${version}/ldap-authentication_${version}.0.0.0.zip";
|
||||||
|
|
@ -240,7 +215,7 @@ in
|
||||||
plugin = lib.mkOption {
|
plugin = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
description = "Pluging used for SSO authentication.";
|
description = "Pluging used for SSO authentication.";
|
||||||
default = mkJellyfinPlugin (rec {
|
default = shb.mkJellyfinPlugin (rec {
|
||||||
pname = "jellyfin-plugin-sso";
|
pname = "jellyfin-plugin-sso";
|
||||||
version = "3.5.2.4";
|
version = "3.5.2.4";
|
||||||
url = "https://github.com/9p4/${pname}/releases/download/v${version}/sso-authentication_${version}.zip";
|
url = "https://github.com/9p4/${pname}/releases/download/v${version}/sso-authentication_${version}.zip";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue