many many new things
This commit is contained in:
parent
2e16f22d37
commit
054b18e763
8 changed files with 125 additions and 66 deletions
|
|
@ -115,9 +115,19 @@ in
|
|||
# some global settings
|
||||
services.prometheus.exporters.node.enabledCollectors = [ "systemd" ];
|
||||
services.prometheus.exporters.dnsmasq.leasesPath = "/var/lib/dnsmasq/dnsmasq.leases";
|
||||
systemd.services."prometheus-smartctl-exporter".serviceConfig.DeviceAllow = [ "* r" ];
|
||||
services.prometheus.exporters.smartctl.user = "root";
|
||||
services.prometheus.exporters.smartctl.group = "root";
|
||||
services.prometheus.exporters.smokeping.hosts = [ "1.1.1.1" ];
|
||||
services.nginx.statusPage = true;
|
||||
services.prometheus.exporters.nginxlog.user = "nginx";
|
||||
services.prometheus.exporters.nginxlog.group = "nginx";
|
||||
services.prometheus.exporters.nginxlog.settings = {
|
||||
namespaces = [ {
|
||||
name = "nginx";
|
||||
format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
|
||||
source.files = [ "/var/log/nginx/access.log" ];
|
||||
}];
|
||||
};
|
||||
}
|
||||
(mkIf (builtins.elem hostName cfg.promtail.hosts) {
|
||||
services.promtail = {
|
||||
|
|
|
|||
44
nixos-modules/services/photoprism.nix
Normal file
44
nixos-modules/services/photoprism.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
with lib.my;
|
||||
let
|
||||
cfg = config.ragon.services.photoprism;
|
||||
domain = config.ragon.services.nginx.domain;
|
||||
in
|
||||
{
|
||||
options.ragon.services.photoprism.enable = mkEnableOption "Enables the hedgedoc BitWarden Server";
|
||||
options.ragon.services.photoprism.domainPrefix =
|
||||
mkOption {
|
||||
type = lib.types.str;
|
||||
default = "photos";
|
||||
};
|
||||
options.ragon.services.photoprism.port =
|
||||
mkOption {
|
||||
type = lib.types.str;
|
||||
default = "28452";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers.photoprism = {
|
||||
ports = [ "127.0.0.1:${cfg.port}:2342" ];
|
||||
image = "photoprism/photoprism:latest";
|
||||
environmentFiles = [ config.age.secrets.photoprismEnv.path ];
|
||||
workdir = "/photoprism"; # upstream says so
|
||||
user = "1000:100";
|
||||
volumes = [
|
||||
"/data/pictures:/photoprism/originals"
|
||||
"/data/applications/photoprismimport:/photoprism/import"
|
||||
"/var/lib/photoprism:/photoprism/storage"
|
||||
];
|
||||
};
|
||||
ragon.agenix.secrets.photoprismEnv.owner = "root";
|
||||
services.nginx.virtualHosts."${cfg.domainPrefix}.${domain}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "${domain}";
|
||||
locations."/".proxyWebsockets = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:${cfg.port}";
|
||||
};
|
||||
ragon.persist.extraDirectories = [
|
||||
"/var/lib/photoprism"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue