sombrero: Add plex module
This commit is contained in:
@@ -76,7 +76,6 @@
|
||||
80
|
||||
443
|
||||
1122 # ssh
|
||||
32400 # plex
|
||||
8181 # books-sync
|
||||
8384 # syncthing
|
||||
8083 # calibre-web
|
||||
@@ -311,24 +310,6 @@
|
||||
|
||||
virtualisation = {
|
||||
oci-containers.containers = {
|
||||
plex = {
|
||||
image = "linuxserver/plex";
|
||||
autoStart = true;
|
||||
|
||||
environment = {
|
||||
TZ = "Europe/Stockholm";
|
||||
VERSION = "latest";
|
||||
};
|
||||
|
||||
extraOptions = [ "--network=host" ];
|
||||
|
||||
volumes = [
|
||||
"/home/alex/media/plex/db:/config"
|
||||
"/home/alex/media/Movies:/movies"
|
||||
"/home/alex/media/TV:/tv"
|
||||
];
|
||||
};
|
||||
|
||||
koreader-sync = {
|
||||
image = "localhost/koreader-sync";
|
||||
autoStart = true;
|
||||
@@ -380,6 +361,7 @@
|
||||
|
||||
mod = {
|
||||
docker.enable = true;
|
||||
plex.enable = true;
|
||||
};
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
|
||||
42
hosts/sombrero/modules/plex/default.nix
Normal file
42
hosts/sombrero/modules/plex/default.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
enable = config.mod.plex.enable;
|
||||
dockerEnabled = config.mod.docker.enable;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
mod.plex = {
|
||||
enable = lib.mkEnableOption "enable plex module";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (enable && dockerEnabled) {
|
||||
virtualisation = {
|
||||
oci-containers.containers = {
|
||||
plex = {
|
||||
image = "linuxserver/plex";
|
||||
autoStart = true;
|
||||
|
||||
environment = {
|
||||
TZ = "Europe/Stockholm";
|
||||
VERSION = "latest";
|
||||
};
|
||||
|
||||
extraOptions = [ "--network=host" ];
|
||||
|
||||
volumes = [
|
||||
"/home/alex/media/plex/db:/config"
|
||||
"/home/alex/media/Movies:/movies"
|
||||
"/home/alex/media/TV:/tv"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [ 32400 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user