mirror of
https://github.com/mdlayher/homelab.git
synced 2024-12-14 11:47:32 +00:00
nixos/servnerr-3: move Plex into a NixOS container
Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
parent
d08e8f2584
commit
fa5d3beb81
1 changed files with 25 additions and 5 deletions
|
@ -98,9 +98,6 @@ in {
|
|||
serviceConfig = { Restart = "always"; };
|
||||
};
|
||||
|
||||
# Allow the use of Plex.
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Scale down CPU frequency when load is low.
|
||||
powerManagement.cpuFreqGovernor = "ondemand";
|
||||
|
||||
|
@ -131,8 +128,6 @@ in {
|
|||
passwordAuthentication = false;
|
||||
};
|
||||
|
||||
plex.enable = true;
|
||||
|
||||
zfs.autoScrub.enable = true;
|
||||
};
|
||||
|
||||
|
@ -156,6 +151,31 @@ in {
|
|||
};
|
||||
|
||||
containers = {
|
||||
# Plex server running containerized and on unstable for faster updates.
|
||||
plex = {
|
||||
autoStart = true;
|
||||
bindMounts = {
|
||||
# Mount the existing data directory.
|
||||
"/var/lib/plex" = {
|
||||
hostPath = "/var/lib/plex";
|
||||
isReadOnly = false;
|
||||
};
|
||||
# Mount the ZFS pool as read-only.
|
||||
"/primary/media" = {
|
||||
hostPath = "/primary/media";
|
||||
isReadOnly = true;
|
||||
};
|
||||
};
|
||||
config = { config, pkgs, ... }:
|
||||
let unstable = import <unstable> { config.allowUnfree = true; };
|
||||
in {
|
||||
services.plex = {
|
||||
enable = true;
|
||||
package = unstable.plex;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# UniFi controller running containerized and on unstable for faster updates.
|
||||
unifi = {
|
||||
autoStart = true;
|
||||
|
|
Loading…
Reference in a new issue