nixos/modules/plex/default.nix

38 lines
1.1 KiB
Nix
Raw Normal View History

2022-11-02 21:27:28 +01:00
{ inputs, config, ... }:
2022-01-24 22:10:46 +01:00
{
2022-11-02 15:40:09 +01:00
age.secrets.plexClaim.file = "${inputs.self}/scrts/plex_claim.age";
2022-01-24 22:10:46 +01:00
networking = {
2022-01-25 06:40:25 +01:00
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
];
2022-01-24 22:10:46 +01:00
};
2022-11-02 15:40:09 +01:00
virtualisation.oci-containers = {
backend = "docker";
containers."plex" = {
image = "plexinc/pms-docker";
autoStart = true;
environment = {
TZ = "Europe/Zurich";
};
environmentFiles = [ config.age.secrets.plexClaim.path ];
volumes = [
2022-11-02 16:53:45 +01:00
"/var/lib/plex/config:/config"
"/var/lib/plex/tmp:/transcode"
2022-11-02 15:40:09 +01:00
];
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"
];
};
};
2022-01-24 22:10:46 +01:00
}