Skip to content

Commit

Permalink
feat(nix): use fetchzip in jellyfin module to get plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Nov 25, 2024
1 parent 1ce0169 commit b07e2b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nix/modules/home/desktop/addons/wezterm/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local act = wezterm.action
config.leader = { key = "b", mods = "CTRL" }

config.keys = {
{ key = " ", mods = "SHIFT", action = act.QuickSelect },
{ key = "o", mods = "LEADER", action = act.QuickSelect },
{
key = "-",
mods = "ALT",
Expand Down
20 changes: 13 additions & 7 deletions nix/modules/nixos/containers/jellyfin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,18 @@ in {
};

config = {pkgs, ...}: {
# networking.hosts = {
# #TODO: remove this once migrated
# "${cfg.hostAddress}" = [
# "authelia.sbulav.ru"
# ];
# };
systemd.tmpfiles.rules = [
"d /var/lib/jellyfin 700 jellyfin jellyfin -"
];
services.jellyfin = {
enable = true;
};
systemd.services.jellyfin.preStart = let
sso-authentication-plugin = pkgs.fetchzip {
stripRoot = false;
url = "https://github.com/9p4/jellyfin-plugin-sso/releases/download/v3.5.2.4/sso-authentication_3.5.2.4.zip";
hash = "sha256-e+w5m6/7vRAynStDj34eBexfCIEgDJ09huHzi5gQEbo=";
};
ssoConfig = pkgs.writeTextFile {
name = "SSO-Auth.xml";
text = ''
Expand Down Expand Up @@ -162,15 +161,22 @@ in {
executable = false;
};
in ''
# Setting up SSO integration
mkdir -p /var/lib/jellyfin/plugins
CLIENT_SECRET="$(cat ${config.sops.secrets."jellyfin/oidc_client_secret".path})"
sed "s/CLIENT_SECRET_REPLACE/$CLIENT_SECRET/" ${ssoConfig} > /var/lib/jellyfin/plugins/configurations/SSO-Auth.xml
cat ${brandingConfig} > /var/lib/jellyfin/config/branding.xml
# Setting up SSO plugin
rm -rf /var/lib/jellyfin/plugins/sso-authentication-plugin
mkdir -p /var/lib/jellyfin/plugins/sso-authentication-plugin
cp ${sso-authentication-plugin}/* /var/lib/jellyfin/plugins/sso-authentication-plugin/
chmod -R 770 /var/lib/jellyfin/plugins/sso-authentication-plugin
'';

networking = {
firewall = {
enable = false;
enable = true;
# https://jellyfin.org/docs/general/networking/index.html#port-bindings
allowedTCPPorts = [8096 8920];
allowedUDPPorts = [1900 7359];
Expand Down

0 comments on commit b07e2b0

Please sign in to comment.