feat(jellyfin): will this break things?
This commit is contained in:
@@ -3,18 +3,20 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
service = "jellyfin";
|
let
|
||||||
cfg = config.server.${service};
|
unit = "jellyfin";
|
||||||
|
cfg = config.server.${unit};
|
||||||
srv = config.server;
|
srv = config.server;
|
||||||
in {
|
in
|
||||||
options.server.${service} = {
|
{
|
||||||
|
options.server.${unit} = {
|
||||||
enable = lib.mkEnableOption {
|
enable = lib.mkEnableOption {
|
||||||
description = "Enable ${service}";
|
description = "Enable ${unit}";
|
||||||
};
|
};
|
||||||
configDir = lib.mkOption {
|
configDir = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "/var/lib/${service}";
|
default = "/var/lib/${unit}";
|
||||||
};
|
};
|
||||||
url = lib.mkOption {
|
url = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
@@ -38,7 +40,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.${service} = {
|
services.${unit} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = srv.user;
|
user = srv.user;
|
||||||
group = srv.group;
|
group = srv.group;
|
||||||
@@ -49,14 +51,13 @@ in {
|
|||||||
services.traefik = {
|
services.traefik = {
|
||||||
dynamicConfigOptions = {
|
dynamicConfigOptions = {
|
||||||
http = {
|
http = {
|
||||||
services.jellyfin.loadBalancer.servers = [{url = "http://127.0.0.1:8096";}];
|
services.${unit}.loadBalancer.servers = [ { url = "http://127.0.0.1:8096"; } ];
|
||||||
routers = {
|
routers = {
|
||||||
jellyfin = {
|
jellyfinRouter = {
|
||||||
entryPoints = [ "websecure" ];
|
entryPoints = [ "websecure" ];
|
||||||
rule = "Host(`${cfg.url}`)";
|
rule = "Host(`sobotka.taila7448a.ts.net.ts.net`)";
|
||||||
service = "jellyfin";
|
service = "${unit}";
|
||||||
tls.certResolver = "letsencrypt";
|
tls.certResolver = "tailscale";
|
||||||
# middlewares = ["authentik"];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user