diff --git a/system/servenix/default.nix b/system/servenix/default.nix index d6c5598c..4d6fb3f5 100644 --- a/system/servenix/default.nix +++ b/system/servenix/default.nix @@ -25,6 +25,7 @@ # General services ../services/authelia.nix ../services/bazarr.nix + ../services/box.nix ../services/fileflows.nix ../services/gitea.nix ../services/immich.nix diff --git a/system/servenix/hardware-configuration.nix b/system/servenix/hardware-configuration.nix index 1ce142f8..7bbd6548 100644 --- a/system/servenix/hardware-configuration.nix +++ b/system/servenix/hardware-configuration.nix @@ -63,6 +63,12 @@ fsType = "nfs"; options = ["defaults" "rw" "relatime" "_netdev" "bg" "soft"]; }; + + "/media/Box" = { + device = "192.168.86.20:/mnt/Seagate4TB/Box"; + fsType = "nfs"; + options = ["defaults" "rw" "relatime" "_netdev" "bg" "soft"]; + }; }; swapDevices = [ diff --git a/system/services/box.nix b/system/services/box.nix new file mode 100644 index 00000000..0e277a3b --- /dev/null +++ b/system/services/box.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + pkgs, + ... +}: let + boxVersion = "v0.29.3"; +in { + virtualisation.oci-containers.containers = { + box = { + image = "stashapp/stash:${boxVersion}"; + autoStart = true; + + login = { + # Uses DockerHub by default + # registry = ""; + + # DockerHub Credentials + username = "christoph.urlacher@protonmail.com"; + passwordFile = "${config.sops.secrets.docker-password.path}"; + }; + + dependsOn = []; + + ports = [ + # "9999:9999" + ]; + + volumes = [ + "/etc/localtime:/etc/localtime:ro" + + "/media/Box:/data" + + "box_config:/root/.stash" + "box_metadata:/metadata" + "box_cache:/cache" + "box_blobs:/blobs" + "box_generated:/generated" + ]; + + environment = { + PUID = "3000"; + PGID = "3000"; + TZ = "Europe/Berlin"; + + STASH_STASH = "/data/"; + STASH_GENERATED = "/generated/"; + STASH_METADATA = "/metadata/"; + STASH_CACHE = "/cache/"; + }; + + extraOptions = [ + "--privileged" + "--device=nvidia.com/gpu=all" + "--net=behind-nginx" + ]; + }; + }; +}