1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00
mdlayher-homelab/nixos/servnerr-3/containers.nix

62 lines
1.5 KiB
Nix

{ pkgs, ... }:
{
# These services are proprietary and run containerized for confinement from
# the rest of the system and on unstable for faster update cycles.
containers = {
plex = {
autoStart = true;
bindMounts = {
# Mount the ZFS pool as read-only.
"/primary/media" = {
hostPath = "/primary/media";
isReadOnly = true;
};
};
config = { ... }:
let
unstable =
import <nixos-unstable-small> { config.allowUnfree = true; };
in {
services.plex = {
enable = true;
package = unstable.plex;
};
};
};
unifi = {
autoStart = true;
config = { ... }:
let
unstable =
import <nixos-unstable-small> { config.allowUnfree = true; };
in {
services.unifi = {
enable = true;
unifiPackage = unstable.unifi;
};
};
};
};
virtualisation.oci-containers = {
backend = "podman";
containers = {
home-assistant = {
image = "homeassistant/home-assistant:stable";
extraOptions = [ "--network=host" ];
ports = [ "8123:8123" ];
volumes =
[ "/etc/localtime:/etc/localtime:ro" "/var/lib/hass:/config" ];
};
# promlens running on TCP/9091 adjacent to Prometheus.
promlens = {
image = "promlabs/promlens";
ports = [ "9091:8080" ];
volumes = [ "/var/lib/promlens:/var/lib/promlens" ];
};
};
};
}