server and other shit
This commit is contained in:
parent
270e1a0be4
commit
804371bf96
65 changed files with 1428 additions and 619 deletions
70
modules/server/cloud/immich.nix
Normal file
70
modules/server/cloud/immich.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
server.cloud.immich = {
|
||||
enable = lib.mkEnableOption "enable immich";
|
||||
port = lib.mkOption {
|
||||
default = 2283;
|
||||
description = "immich port";
|
||||
};
|
||||
public = lib.mkEnableOption "public immich";
|
||||
subdomain = lib.mkOption {
|
||||
default = "photos";
|
||||
description = "immich subdomain";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
users =
|
||||
if config.server.cloud.immich.enable then
|
||||
{
|
||||
users.immich = {
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
home = "/var/lib/immich";
|
||||
group = "immich";
|
||||
extraGroups = [
|
||||
"video"
|
||||
"render"
|
||||
];
|
||||
};
|
||||
groups.immich = { };
|
||||
}
|
||||
else
|
||||
{ };
|
||||
services = {
|
||||
immich = {
|
||||
enable = config.server.cloud.immich.enable;
|
||||
port = config.server.cloud.immich.port;
|
||||
host = "127.0.0.1";
|
||||
machine-learning = {
|
||||
enable = true;
|
||||
environment = {
|
||||
MACHINE_LEARNING_MODEL_TTL = "600";
|
||||
MACHINE_LEARNING_REQUEST_THREADS = "4";
|
||||
MACHINE_LEARNING_MODEL_INTER_OP_THREADS = "2";
|
||||
};
|
||||
};
|
||||
};
|
||||
nginx =
|
||||
if config.server.cloud.immich.enable && config.server.cloud.immich.public then
|
||||
{
|
||||
virtualHosts."${config.server.cloud.immich.subdomain}.${config.networking.domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.server.cloud.immich.port}";
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{ };
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue