dotfiles.nix/nixos/viridian/services/paperless-ngx/default.nix

50 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2024-09-20 20:24:55 +08:00
{config, ...}: let
2024-10-16 04:59:59 +08:00
dir = "/var/lib/paperless-ngx";
2024-09-20 20:24:55 +08:00
in {
age.secrets.paperless-ngx = {
rekeyFile = ./password.age;
};
services.paperless = {
enable = true;
port = 28981;
dataDir = "${dir}";
mediaDir = "${dir}/media";
settings = {
PAPERLESS_ADMIN_USER = "sajenim";
};
passwordFile = config.age.secrets.paperless-ngx.path;
};
services.traefik.dynamicConfigOptions.http.routers = {
paperless-ngx = {
2024-11-22 07:15:34 +08:00
rule = "Host(`docs.home.arpa`)";
2024-09-20 20:24:55 +08:00
entryPoints = [
"websecure"
];
service = "paperless-ngx";
};
};
services.traefik.dynamicConfigOptions.http.services = {
paperless-ngx.loadBalancer.servers = [
{url = "http://127.0.0.1:${toString config.services.paperless.port}";}
];
};
2024-10-16 04:59:59 +08:00
environment.persistence."/persist" = {
directories = [
{
directory = "/var/lib/paperless-ngx";
user = "paperless";
group = "paperless";
}
{
directory = "/var/lib/redis-paperless";
user = "redis-paperless";
group = "redis-paperless";
}
];
};
2024-09-20 20:24:55 +08:00
}