Add photoprism module

This commit is contained in:
Jordan Holt 2024-03-31 19:46:37 +01:00
parent 544c511341
commit 93ac4b1185
Signed by: jordan
GPG Key ID: B8CFFF61F1CCF520
3 changed files with 45 additions and 0 deletions

View File

@ -62,6 +62,7 @@
headscale.enable = true; headscale.enable = true;
matrix-synapse.enable = true; matrix-synapse.enable = true;
nginx.enable = true; nginx.enable = true;
photoprism.enable = true;
}; };
}; };

View File

@ -36,6 +36,7 @@
./services/headscale ./services/headscale
./services/matrix-synapse ./services/matrix-synapse
./services/nginx ./services/nginx
./services/photoprism
./shell/git ./shell/git
./shell/zsh ./shell/zsh
]; ];

View File

@ -0,0 +1,43 @@
{ config, lib, pkgs, inputs, ... }:
with lib;
let cfg = config.modules.services.photoprism;
in {
options.modules.services.photoprism = {
enable = mkOption {
default = false;
example = true;
};
};
config = mkIf cfg.enable {
services.nginx = {
virtualHosts = {
"gallery.vimium.com" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:${config.services.photoprism.port}";
};
};
};
age.secrets."passwords/services/photoprism/admin" = {
file = "${inputs.secrets}/passwords/services/photoprism/admin.age";
};
services.photoprism = {
enable = true;
address = "localhost";
passwordFile = config.age.secrets."passwords/services/photoprism/admin".path;
settings = {
PHOTOPRISM_APP_NAME = "Vimium Gallery";
PHOTOPRISM_SITE_AUTHOR = "Vimium";
PHOTOPRISM_SITE_TITLE = "Vimium Gallery";
PHOTOPRISM_SITE_CAPTION = "See your photos and videos on gallery.vimium.com";
PHOTOPRISM_DISABLE_TLS = true;
PHOTOPRISM_SPONSOR = true;
};
};
};
}