Add photoprism

This commit is contained in:
Payas Relekar 2023-07-07 21:13:41 +05:30
parent fb6533dea0
commit 49eba2202c
4 changed files with 47 additions and 0 deletions

View file

@ -88,6 +88,7 @@
./modules/vaultwarden.nix
./modules/hledger.nix
./modules/etesync.nix
./modules/photoprism.nix
# Host-specific config
nixos-hardware.nixosModules.raspberry-pi-4

Binary file not shown.

View file

@ -19,4 +19,5 @@ in
"gandalf_mail.age".publicKeys = [ ageKey ];
"nginx.age".publicKeys = [ ageKey ];
"etebase.age".publicKeys = [ ageKey ];
"photoprism.age".publicKeys = [ ageKey ];
}

45
modules/photoprism.nix Normal file
View file

@ -0,0 +1,45 @@
{ ... }:
{
systemd.tmpfiles.rules = [
"f /run/agenix/photoprism 0770 photoprism photoprism -"
];
services = {
photoprism = {
enable = true;
port = 2342;
address = "photo.bhankas.org";
passwordFile = "/run/agenix/photoprism";
settings = {
PHOTOPRISM_ADMIN_USER = "root";
};
};
nginx = {
enable = true;
virtualHosts = {
"photo.bhankas.org" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:2342";
proxyWebsockets = false;
extraConfig =
"proxy_set_header Host $host;\n"
;
};
};
};
};
};
security.acme = {
acceptTerms = true;
certs = {
"photo.bhankas.org" = {
email = "admin@bhankas.org";
dnsResolver = "1.1.1.1:53";
};
};
};
}