feat: Plex without synchronized config
This commit is contained in:
parent
217fee5b3f
commit
8c3bb2b3ce
1 changed files with 36 additions and 8 deletions
|
|
@ -6,14 +6,37 @@ in {
|
||||||
options.homelab.apps.plex.enable = lib.mkEnableOption "Plex";
|
options.homelab.apps.plex.enable = lib.mkEnableOption "Plex";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
homelab = {
|
||||||
|
users = {
|
||||||
|
apps.enable = true;
|
||||||
|
media.enable = true;
|
||||||
|
};
|
||||||
|
virtualisation.containers.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
users.users.plex = {
|
users.users.plex = {
|
||||||
uid = lib.mkForce 3009;
|
uid = lib.mkForce 3009;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = config.users.groups.media;
|
group = config.users.groups.apps.name;
|
||||||
|
extraGroups = [
|
||||||
|
config.users.groups.media.name
|
||||||
|
];
|
||||||
home = "/var/empty";
|
home = "/var/empty";
|
||||||
shell = null;
|
shell = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems."/srv/video" = {
|
||||||
|
device = "192.168.0.11:/mnt/SMALL/MEDIA/VIDEO";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = [
|
||||||
|
"ro"
|
||||||
|
"nfsvers=4.2"
|
||||||
|
"async" "soft"
|
||||||
|
"timeo=100" "retry=50" "actimeo=1800" "lookupcache=all"
|
||||||
|
"nosuid" "tcp"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.oci-containers.containers = {
|
virtualisation.oci-containers.containers = {
|
||||||
plex = {
|
plex = {
|
||||||
hostname = "plex";
|
hostname = "plex";
|
||||||
|
|
@ -30,20 +53,25 @@ in {
|
||||||
# "8324:8324/tcp" # Controlling Plex for Roku via Plex Companion
|
# "8324:8324/tcp" # Controlling Plex for Roku via Plex Companion
|
||||||
];
|
];
|
||||||
environment = {
|
environment = {
|
||||||
ADVERTISE_AP = "..."; # TODO Configure ip
|
#ADVERTISE_AP = "..."; # TODO Configure ip
|
||||||
ALLOWED_NETWORKS = "192.168.0.0/24,172.16.0.0/16";
|
ALLOWED_NETWORKS = "192.168.0.0/24,172.16.0.0/16";
|
||||||
CHANGE_CONFIG_DIR_OWNERSHIP = "false";
|
CHANGE_CONFIG_DIR_OWNERSHIP = "false";
|
||||||
HOSTNAME = "PlexServer";
|
HOSTNAME = "PlexServer";
|
||||||
PLEX_CLAIM = "..."; # TODO Add token
|
#PLEX_CLAIM = "..."; # TODO Add token
|
||||||
PLEX_UID = config.users.users.plex.uid;
|
PLEX_UID = toString config.users.users.plex.uid;
|
||||||
PLEX_GID = config.users.groups.media.gid;
|
PLEX_GID = toString config.users.groups.media.gid;
|
||||||
TZ = config.time.timeZone;
|
TZ = config.time.timeZone;
|
||||||
};
|
};
|
||||||
volumes = [
|
volumes = [
|
||||||
# TODO "config:/var/lib/plexmediaserver"
|
"plex-config:/var/lib/plexmediaserver"
|
||||||
# TODO "transcode-temp:/transcode"
|
"plex-transcode:/transcode"
|
||||||
# TODO "media:/data"
|
"/srv/video:/data/video"
|
||||||
];
|
];
|
||||||
|
labels = {
|
||||||
|
"traefik.enable" = "true";
|
||||||
|
"traefik.http.routers.plex.rule=" = "Host(`plex.depeuter.dev`)";
|
||||||
|
"traefik.http.services.plex.loadbalancer.server.port" = "32400";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue