mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Add Immich
This commit is contained in:
parent
a5637b3c07
commit
0facce0860
6 changed files with 70 additions and 3 deletions
43
modules/immich.nix
Normal file
43
modules/immich.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.services.immich;
|
||||
externalDomain = "photos.${config.networking.domain}";
|
||||
in
|
||||
{
|
||||
options.custom.services.immich = {
|
||||
enable = lib.mkEnableOption "immich";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets.immichSecretsFile = {
|
||||
owner = config.systemd.services.immich-server.serviceConfig.User;
|
||||
key = "immich/secrets_file";
|
||||
restartUnits = [ "immich-server.service" ];
|
||||
};
|
||||
|
||||
services = {
|
||||
immich = {
|
||||
enable = true;
|
||||
host = "127.0.0.1";
|
||||
group = "nextcloud";
|
||||
secretsFile = config.sops.secrets.immichSecretsFile.path;
|
||||
database.host = "127.0.0.1";
|
||||
settings = {
|
||||
server.externalDomain = "https://${externalDomain}";
|
||||
};
|
||||
};
|
||||
nginx = {
|
||||
virtualHosts = {
|
||||
${externalDomain} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.immich.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue