mkModule various

This commit is contained in:
mjallen18
2025-12-17 12:52:42 -06:00
parent 50345adeb5
commit 96ce0001c5
16 changed files with 462 additions and 636 deletions

View File

@@ -6,33 +6,36 @@
}:
with lib;
let
cfg = config.${namespace}.services.immich;
immichPort = 2283;
dataDir = "/media/nas/main/photos";
name = "immich";
cfg = config.${namespace}.services.${name};
dbPassword = config.sops.secrets."jallen-nas/immich/db-password".path;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
immichConfig = lib.${namespace}.mkModule {
inherit config name;
description = "immich";
options = { };
moduleConfig = {
# Enable immich service
services.immich = {
enable = true;
port = immichPort;
openFirewall = true;
secretsFile = dbPassword;
mediaLocation = dataDir;
environment = {
IMMICH_HOST = lib.mkForce "0.0.0.0";
IMMICH_TRUSTED_PROXIES = "10.0.1.3";
TZ = "America/Chicago";
};
machine-learning = {
services.immich = {
enable = true;
port = cfg.port;
openFirewall = true;
secretsFile = dbPassword;
mediaLocation = "${cfg.dataDir}/photos";
environment = {
IMMICH_HOST = lib.mkForce cfg.listenAddress;
IMMICH_TRUSTED_PROXIES = "10.0.1.3";
TZ = "America/Chicago";
};
machine-learning = {
enable = true;
};
};
};
};
in
{
imports = [ immichConfig ];
}

View File

@@ -1,7 +0,0 @@
{ lib, namespace, ... }:
with lib;
{
options.${namespace}.services.immich = {
enable = mkEnableOption "enable immich";
};
}