2023-05-12 22:05:10 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
2021-07-13 09:53:22 +01:00
|
|
|
|
2022-04-05 13:05:08 +01:00
|
|
|
let
|
|
|
|
domain = "media.giugl.io";
|
2023-05-12 22:05:10 +01:00
|
|
|
port = 8096;
|
2023-06-05 02:11:46 +01:00
|
|
|
allowLan = true;
|
2022-11-20 13:55:59 +00:00
|
|
|
in
|
|
|
|
{
|
2023-02-27 19:01:01 +00:00
|
|
|
# needed since StateDirectory does not accept symlinks
|
|
|
|
systemd.services.jellyfin.serviceConfig.StateDirectory = lib.mkForce "";
|
2023-02-11 02:26:30 +00:00
|
|
|
|
2023-06-05 02:11:46 +01:00
|
|
|
architect.vhost.${domain} = with config.architect.networks; {
|
2023-10-21 14:00:58 +01:00
|
|
|
dnsInterfaces = [ "lan" "tailscale" ];
|
2023-06-05 02:11:46 +01:00
|
|
|
locations = {
|
|
|
|
"/" = {
|
|
|
|
inherit port allowLan;
|
2022-04-05 16:07:56 +01:00
|
|
|
|
2023-06-05 02:11:46 +01:00
|
|
|
allow = [
|
|
|
|
tailscale.net
|
|
|
|
];
|
2022-04-05 13:05:08 +01:00
|
|
|
};
|
2022-04-05 16:07:56 +01:00
|
|
|
|
2023-06-05 02:11:46 +01:00
|
|
|
"/socket" = {
|
|
|
|
inherit port allowLan;
|
|
|
|
|
2022-04-05 13:05:08 +01:00
|
|
|
proxyWebsockets = true;
|
2023-06-05 02:11:46 +01:00
|
|
|
allow = [
|
|
|
|
tailscale.net
|
|
|
|
];
|
2021-07-07 13:13:19 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-05 02:11:46 +01:00
|
|
|
services.jellyfin = {
|
|
|
|
enable = true;
|
|
|
|
group = "media";
|
|
|
|
package = pkgs.unstablePkgs.jellyfin;
|
|
|
|
};
|
2021-07-07 13:13:19 +01:00
|
|
|
|
2023-05-12 22:05:10 +01:00
|
|
|
users.groups = {
|
|
|
|
media.members = [ "jellyfin" ];
|
|
|
|
video.members = [ "jellyfin" ];
|
|
|
|
render.members = [ "jellyfin" ];
|
|
|
|
};
|
2022-03-15 15:58:04 +00:00
|
|
|
|
|
|
|
fileSystems."/tmp/jellyfin" = {
|
|
|
|
device = "none";
|
|
|
|
fsType = "tmpfs";
|
|
|
|
options = [ "defaults" "size=20G" "uid=jellyfin" ];
|
|
|
|
};
|
2021-07-07 13:13:19 +01:00
|
|
|
}
|