moved service config out of host namespace

This commit is contained in:
Leyla Becker 2025-03-22 13:27:04 -05:00
parent c7938c3fe7
commit 597c25b49d
7 changed files with 98 additions and 125 deletions

View file

@ -6,8 +6,7 @@
}: let
mediaLocation = "/var/lib/immich";
in {
options.host.immich = {
enable = lib.mkEnableOption "should immich be enabled on this computer";
options.services.immich = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that immich will be hosted at";
@ -15,10 +14,10 @@ in {
};
};
config = lib.mkIf config.host.immich.enable (lib.mkMerge [
config = lib.mkIf config.services.immich.enable (lib.mkMerge [
{
host = {
reverse_proxy.subdomains.${config.host.immich.subdomain} = {
reverse_proxy.subdomains.${config.services.immich.subdomain} = {
target = "http://localhost:${toString config.services.immich.port}";
websockets.enable = true;
@ -45,12 +44,6 @@ in {
};
};
services.immich = {
enable = true;
port = 2283;
# redis.enable = false;
};
networking.firewall.interfaces.${config.services.tailscale.interfaceName} = {
allowedUDPPorts = [
config.services.immich.port
@ -89,8 +82,6 @@ in {
}
];
environment.persistence."/persist/system/root" = {
enable = true;
hideMounts = true;
directories = [
{
directory = mediaLocation;