mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 00:57:22 +01:00
chore: clean up flake
This commit is contained in:
parent
178d51cde6
commit
6ca7717d3e
63 changed files with 5134 additions and 1157 deletions
|
|
@ -1,16 +1,20 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{ lib, pkgs, config, globals, ... }:
|
||||
let
|
||||
serviceDomain = "scan.swarsel.win";
|
||||
servicePort = 28981;
|
||||
serviceUser = "paperless";
|
||||
serviceGroup = serviceUser;
|
||||
serviceName = "paperless";
|
||||
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
|
||||
|
||||
tikaPort = 9998;
|
||||
gotenbergPort = 3002;
|
||||
kanidmDomain = globals.services.kanidm.domain;
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.server."${serviceName}" = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselsystems.modules.server."${serviceName}" {
|
||||
options.swarselsystems.modules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselsystems.modules.server.${serviceName} {
|
||||
|
||||
users.users."${serviceUser}" = {
|
||||
users.users.${serviceUser} = {
|
||||
extraGroups = [ "users" ];
|
||||
};
|
||||
|
||||
|
|
@ -28,25 +32,25 @@ in
|
|||
globals.services.${serviceName}.domain = serviceDomain;
|
||||
|
||||
services = {
|
||||
paperless = {
|
||||
${serviceName} = {
|
||||
enable = true;
|
||||
mediaDir = "/Vault/Eternor/Paperless";
|
||||
dataDir = "/Vault/data/paperless";
|
||||
dataDir = "/Vault/data/${serviceName}";
|
||||
user = serviceUser;
|
||||
port = servicePort;
|
||||
passwordFile = config.sops.secrets.paperless_admin.path;
|
||||
address = "0.0.0.0";
|
||||
settings = {
|
||||
PAPERLESS_OCR_LANGUAGE = "deu+eng";
|
||||
PAPERLESS_URL = "https://scan.swarsel.win";
|
||||
PAPERLESS_URL = "https://${serviceDomain}";
|
||||
PAPERLESS_OCR_USER_ARGS = builtins.toJSON {
|
||||
optimize = 1;
|
||||
invalidate_digital_signatures = true;
|
||||
pdfa_image_compression = "lossless";
|
||||
};
|
||||
PAPERLESS_TIKA_ENABLED = "true";
|
||||
PAPERLESS_TIKA_ENDPOINT = "http://localhost:9998";
|
||||
PAPERLESS_TIKA_GOTENBERG_ENDPOINT = "http://localhost:3002";
|
||||
PAPERLESS_TIKA_ENDPOINT = "http://localhost:${builtins.toString tikaPort}";
|
||||
PAPERLESS_TIKA_GOTENBERG_ENDPOINT = "http://localhost:${builtins.toString gotenbergPort}";
|
||||
PAPERLESS_APPS = "allauth.socialaccount.providers.openid_connect";
|
||||
PAPERLESS_SOCIALACCOUNT_PROVIDERS = builtins.toJSON {
|
||||
openid_connect = {
|
||||
|
|
@ -58,7 +62,7 @@ in
|
|||
client_id = "paperless";
|
||||
# secret will be added by paperless-web.service (see below)
|
||||
#secret = "";
|
||||
settings.server_url = "https://sso.swarsel.win/oauth2/openid/${client_id}/.well-known/openid-configuration";
|
||||
settings.server_url = "https://${kanidmDomain}/oauth2/openid/${client_id}/.well-known/openid-configuration";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
@ -68,7 +72,7 @@ in
|
|||
|
||||
tika = {
|
||||
enable = true;
|
||||
port = 9998;
|
||||
port = tikaPort;
|
||||
openFirewall = false;
|
||||
listenAddress = "127.0.0.1";
|
||||
enableOcr = true;
|
||||
|
|
@ -77,7 +81,7 @@ in
|
|||
gotenberg = {
|
||||
enable = true;
|
||||
package = pkgs.stable.gotenberg;
|
||||
port = 3002;
|
||||
port = gotenbergPort;
|
||||
bindIP = "127.0.0.1";
|
||||
timeout = "600s";
|
||||
chromium.package = pkgs.stable.chromium;
|
||||
|
|
@ -97,7 +101,7 @@ in
|
|||
|
||||
nodes.moonside.services.nginx = {
|
||||
upstreams = {
|
||||
"${serviceName}" = {
|
||||
${serviceName} = {
|
||||
servers = {
|
||||
"192.168.1.2:${builtins.toString servicePort}" = { };
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue