photoprism: add to fwminex
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
./matrix-synapse
|
||||
./node_exporter
|
||||
./nsd-acme
|
||||
./photoprism
|
||||
./postfix
|
||||
./remote-builder
|
||||
./sshguard
|
||||
|
||||
34
modules/services/photoprism/default.nix
Normal file
34
modules/services/photoprism/default.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.mj.services.photoprism;
|
||||
in
|
||||
{
|
||||
options.mj.services.photoprism = with lib.types; {
|
||||
enable = lib.mkEnableOption "enable photoprism";
|
||||
uidgid = lib.mkOption { type = int; };
|
||||
paths = lib.mkOption { type = attrsOf str; };
|
||||
passwordFile = lib.mkOption { type = str; };
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.photoprism = {
|
||||
enable = true;
|
||||
originalsPath = "/data";
|
||||
passwordFile = cfg.passwordFile;
|
||||
};
|
||||
|
||||
systemd.services.photoprism.serviceConfig = {
|
||||
ProtectHome = lib.mkForce "tmpfs";
|
||||
BindPaths = lib.mapAttrsToList (name: srcpath: "${srcpath}:/data/${name}") cfg.paths;
|
||||
};
|
||||
|
||||
users = {
|
||||
groups.photoprism.gid = cfg.uidgid;
|
||||
users.photoprism = {
|
||||
group = "photoprism";
|
||||
uid = cfg.uidgid;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user