Skip to content

Commit dab0833

Browse files
postgres: add immich
postgres:
1 parent b73427a commit dab0833

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

modules/postgres.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ in
307307
databases = [ "postgres" ] ++ config.services.postgresql.ensureDatabases;
308308
enableJIT = lib.mkIf cfg.recommendedDefaults true;
309309
extensions = lib.mkIf cfg.pgRepackTimer.enable (ps: with ps; [ pg_repack ]);
310+
extensionsToInstall = {
311+
immich = lib.mkIf config.services.immich.enable [ "cube" "earthdistance" "pg_trgm" "unaccent" "uuid-ossp" "vector" "vchord" ];
312+
};
310313
settings.shared_preload_libraries = lib.mkMerge [
311314
(lib.mkIf cfg.configurePgStatStatements [ "pg_stat_statements" ])
312315
(lib.mkIf cfg.preloadAllInstalledExtensions (map getExtensionName cfgInstalledExtensions))
@@ -324,6 +327,7 @@ in
324327
(lib.mkIf (hydra.enable && (!lib.hasInfix ";host=" hydra.dbi)) [
325328
"hydra-evaluator" "hydra-notify" "hydra-send-stats" "hydra-update-gc-roots.service" "hydra-update-gc-roots.timer" "hydra-queue-runner" "hydra-server"
326329
])
330+
(lib.mkIf immich.enable && immich.database.host == "/run/postgresql" [ "immich-machine-learning" "immich-server" ])
327331
(lib.mkIf mailman.enable [ "mailman" "mailman-uwsgi" ])
328332
(lib.mkIf (mastodon.enable && mastodon.database.host == "/run/postgresql") [ "mastodon-sidekiq-all" "mastodon-streaming.target" "mastodon-web" ])
329333
# assume that when host is set, which is not the default, the database is none local

0 commit comments

Comments
 (0)