Move plex into options
This commit is contained in:
parent
1c4c57655f
commit
716ac27fb7
|
@ -34,6 +34,7 @@
|
|||
./services/nginx-fpm
|
||||
./services/nginx-proxy
|
||||
./services/pipewire
|
||||
./plex
|
||||
./services/rclone-webdav
|
||||
./services/rdp
|
||||
./services/restic-client-desktop
|
||||
|
|
|
@ -1,46 +1,55 @@
|
|||
{ config, inputs, ... }:
|
||||
{ config, inputs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.az-plex;
|
||||
in
|
||||
{
|
||||
age.secrets.plexClaim.file = "${inputs.self}/scrts/plex_claim.age";
|
||||
networking = {
|
||||
firewall.allowedTCPPorts = [
|
||||
32400 # Web Interface/ Remote Access
|
||||
];
|
||||
firewall.allowedUDPPorts = [
|
||||
1900 # DLNA
|
||||
5353 # Bonjour/Avahi
|
||||
32410 # GDM network discovery
|
||||
32412 # GDM network discovery
|
||||
32413 # GDM network discovery
|
||||
32414 # GDM network discovery
|
||||
32469 # Plex DLNA Server
|
||||
];
|
||||
options = {
|
||||
services.az-plex.enable = lib.mkEnableOption "Enable Plex running in Docker";
|
||||
};
|
||||
|
||||
services.az-docker.enable = true;
|
||||
config = lib.mkIf cfg.enable {
|
||||
age.secrets.plexClaim.file = "${inputs.self}/scrts/plex_claim.age";
|
||||
networking = {
|
||||
firewall.allowedTCPPorts = [
|
||||
32400 # Web Interface/ Remote Access
|
||||
];
|
||||
firewall.allowedUDPPorts = [
|
||||
1900 # DLNA
|
||||
5353 # Bonjour/Avahi
|
||||
32410 # GDM network discovery
|
||||
32412 # GDM network discovery
|
||||
32413 # GDM network discovery
|
||||
32414 # GDM network discovery
|
||||
32469 # Plex DLNA Server
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "docker";
|
||||
containers."plex" = {
|
||||
autoStart = true;
|
||||
# https://fleet.linuxserver.io/image?name=linuxserver/plex
|
||||
image = "lscr.io/linuxserver/plex:1.32.1";
|
||||
environment = {
|
||||
TZ = " Europe/Zurich ";
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
VERSION = "docker";
|
||||
services.az-docker.enable = true;
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "docker";
|
||||
containers."plex" = {
|
||||
autoStart = true;
|
||||
# https://fleet.linuxserver.io/image?name=linuxserver/plex
|
||||
image = "lscr.io/linuxserver/plex:1.32.1";
|
||||
environment = {
|
||||
TZ = " Europe/Zurich ";
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
VERSION = "docker";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.plexClaim.path ];
|
||||
volumes = [
|
||||
"/var/lib/plex/config:/config"
|
||||
"/var/lib/plex/tmp:/transcode"
|
||||
"/etc/localtime:/etc/localtime:ro"
|
||||
];
|
||||
extraOptions = [
|
||||
''--mount=type=volume,source=media,target=/mnt/media,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/media,"volume-opt=o=addr=10.7.89.108,rw,nfsvers=4.0,nolock,hard,noatime"''
|
||||
"--network=host"
|
||||
"--log-opt=tag='plex'"
|
||||
];
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.plexClaim.path ];
|
||||
volumes = [
|
||||
"/var/lib/plex/config:/config"
|
||||
"/var/lib/plex/tmp:/transcode"
|
||||
"/etc/localtime:/etc/localtime:ro"
|
||||
];
|
||||
extraOptions = [
|
||||
''--mount=type=volume,source=media,target=/mnt/media,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/media,"volume-opt=o=addr=10.7.89.108,rw,nfsvers=4.0,nolock,hard,noatime"''
|
||||
"--network=host"
|
||||
"--log-opt=tag='plex'"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
tag = "plex";
|
||||
time = "02:30";
|
||||
})
|
||||
"${inputs.self}/modules/plex"
|
||||
];
|
||||
services = {
|
||||
az-media-share.enable = true;
|
||||
az-plex.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue