Move the plex data to a normal NFS volume
This commit is contained in:
parent
0bb3d8c7a4
commit
58a4e4f937
|
@ -1,5 +1,7 @@
|
||||||
{ config, inputs, lib, ... }:
|
{ config, inputs, lib, ... }:
|
||||||
let cfg = config.services.az-plex;
|
let
|
||||||
|
cfg = config.services.az-plex;
|
||||||
|
volumePath = "/mnt/media";
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
services.az-plex.enable =
|
services.az-plex.enable =
|
||||||
|
@ -8,6 +10,12 @@ in {
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
age.secrets.plexClaim.file = "${inputs.self}/scrts/plex_claim.age";
|
age.secrets.plexClaim.file = "${inputs.self}/scrts/plex_claim.age";
|
||||||
|
|
||||||
|
fileSystems."${volumePath}" = {
|
||||||
|
device = "10.7.89.108:server_data/nextcloud/data";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = [ "hard" "noatime" "rw" ];
|
||||||
|
};
|
||||||
networking = {
|
networking = {
|
||||||
firewall.allowedTCPPorts = [
|
firewall.allowedTCPPorts = [
|
||||||
32400 # Web Interface/ Remote Access
|
32400 # Web Interface/ Remote Access
|
||||||
|
@ -40,16 +48,12 @@ in {
|
||||||
};
|
};
|
||||||
environmentFiles = [ config.age.secrets.plexClaim.path ];
|
environmentFiles = [ config.age.secrets.plexClaim.path ];
|
||||||
volumes = [
|
volumes = [
|
||||||
|
"${volumePath}:/media"
|
||||||
"/var/lib/plex/config:/config"
|
"/var/lib/plex/config:/config"
|
||||||
"/var/lib/plex/tmp:/transcode"
|
"/var/lib/plex/tmp:/transcode"
|
||||||
"/etc/localtime:/etc/localtime:ro"
|
"/etc/localtime:/etc/localtime:ro"
|
||||||
];
|
];
|
||||||
extraOptions = [
|
extraOptions = [ "--network=host" "--log-opt=tag='plex'" ];
|
||||||
''
|
|
||||||
--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'"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue