Skip to content

Commit

Permalink
remove dependency of jellyfin.nix on sops-nix
Browse files Browse the repository at this point in the history
part of #24
  • Loading branch information
ibizaman authored and ibizaman committed Feb 8, 2024
1 parent 228f7e8 commit 0500096
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions modules/services/jellyfin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@ in
default = "jellyfin_user";
};

sopsFile = lib.mkOption {
ldapPasswordFile = lib.mkOption {
type = lib.types.path;
description = "Sops file location";
example = "secrets/jellyfin.yaml";
description = "File containing the LDAP admin password.";
};

ssoSecretFile = lib.mkOption {
type = lib.types.path;
description = "File containing the SSO shared secret.";
};
};

Expand Down Expand Up @@ -223,21 +227,6 @@ in
'';
};

sops.secrets."jellyfin/ldap_password" = {
inherit (cfg) sopsFile;
mode = "0440";
owner = "jellyfin";
group = "jellyfin";
restartUnits = [ "jellyfin.service" ];
};
sops.secrets."jellyfin/sso_secret" = {
inherit (cfg) sopsFile;
mode = "0440";
owner = "jellyfin";
group = "jellyfin";
restartUnits = [ "jellyfin.service" ];
};

shb.backup.instances.jellyfin = {
sourceDirectories = [
"/var/lib/jellyfin"
Expand Down Expand Up @@ -371,29 +360,23 @@ in
'';
in
template ldapConfig "/var/lib/jellyfin/plugins/configurations/LDAP-Auth.xml" {
"%LDAP_PASSWORD%" = "$(cat /run/secrets/jellyfin/ldap_password)";
"%LDAP_PASSWORD%" = "$(cat ${cfg.ldapPasswordFile})";
}
+ template ssoConfig "/var/lib/jellyfin/plugins/configurations/SSO-Auth.xml" {
"%SSO_SECRET%" = "$(cat /run/secrets/jellyfin/sso_secret)";
"%SSO_SECRET%" = "$(cat ${cfg.ssoSecretFile})";
}
+ template brandingConfig "/var/lib/jellyfin/config/branding.xml" {"%a%" = "%a%";};

shb.authelia.oidcClients = [
{
id = cfg.oidcClientID;
description = "Jellyfin";
secretFile = config.sops.secrets."authelia/jellyfin_sso_secret".path;
secretFile = cfg.ssoSecretFile;
public = false;
authorization_policy = "one_factor";
redirect_uris = [ "https://${cfg.subdomain}.${cfg.domain}/sso/OID/r/${cfg.oidcProvider}" ];
}
];
sops.secrets."authelia/jellyfin_sso_secret" = {
inherit (cfg) sopsFile;
key = "jellyfin/sso_secret";
mode = "0400";
owner = config.shb.authelia.autheliaUser;
};

# For backup

Expand Down

0 comments on commit 0500096

Please sign in to comment.