immich
This commit is contained in:
26
hosts/nas/apps/immich/default.nix
Executable file
26
hosts/nas/apps/immich/default.nix
Executable file
@@ -0,0 +1,26 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
immichPort = 2283;
|
||||
dataDir = "/media/nas/main/photos";
|
||||
dbPassword = config.sops.secrets."jallen-nas/immich/db-password".path;
|
||||
in
|
||||
{
|
||||
# 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.18";
|
||||
TZ = "America/Chicago";
|
||||
};
|
||||
|
||||
machine-learning = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.netbootxyz;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
autoStart = true;
|
||||
image = cfg.image;
|
||||
volumes = [ "${cfg.configPath}:/config" "${cfg.assetsPath}:/assets" ];
|
||||
ports = [ "${cfg.port}:3000" "69:69" "${cfg.port2}:80" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
WEB_APP_PORT = cfg.port;
|
||||
NGINX_PORT = cfg.port2;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.netbootxyz = {
|
||||
enable = mkEnableOption "netbootxyz docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.str;
|
||||
default = "3003";
|
||||
};
|
||||
|
||||
port2 = mkOption {
|
||||
type = types.str;
|
||||
default = "8080";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "netbootxyz";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "ghcr.io/netbootxyz/netbootxyz";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/ssd/nix-app-data/netbootxyz";
|
||||
};
|
||||
|
||||
assetsPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/main/isos";
|
||||
};
|
||||
|
||||
|
||||
puid = mkOption {
|
||||
type = types.str;
|
||||
default = "911";
|
||||
};
|
||||
|
||||
pgid = mkOption {
|
||||
type = types.str;
|
||||
default = "1000";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,7 @@ let
|
||||
giteaUrl = "http://10.0.4.18:3000";
|
||||
actualUrl = "http://10.0.3.18:3333";
|
||||
lubeloggerUrl = "http://10.0.1.18:6754";
|
||||
immichUrl = "http://10.0.1.18:2283";
|
||||
|
||||
# Plugins
|
||||
traefikPlugins = {
|
||||
@@ -275,6 +276,11 @@ in
|
||||
url = lubeloggerUrl;
|
||||
}
|
||||
];
|
||||
immich.loadBalancer.servers = [
|
||||
{
|
||||
url = immichUrl;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
routers = {
|
||||
@@ -358,6 +364,13 @@ in
|
||||
middlewares = [ "crowdsec" "whitelist-geoblock" ];
|
||||
tls.certResolver = "letsencrypt";
|
||||
};
|
||||
immich = {
|
||||
entryPoints = [ "websecure" ];
|
||||
rule = "Host(`immich.${domain}`)";
|
||||
service = "immich";
|
||||
middlewares = [ "crowdsec" "whitelist-geoblock" ];
|
||||
tls.certResolver = "letsencrypt";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user