Update paperless

This commit is contained in:
Benjamin Bädorf 2022-11-28 11:39:28 +01:00
parent 3960ae45c9
commit 12ebe35ece
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
4 changed files with 30 additions and 11 deletions

View file

@ -29,6 +29,7 @@ in
wayvnc
drone-docker-runner
stdenv.cc.cc.lib
pkgs.hplip
];
age.secrets."vnc-key.pem" = {

View file

@ -43,11 +43,17 @@ in
nix.binaryCachePublicKeys = cfg.publicKeys;
# These entries get added to /etc/hosts
networking.hosts = {
"127.0.0.1" = [ ]
networking.hosts =
let
hostnames = [ ]
++ lib.optionals cfg.enableCaddy [ "caddy.local" ]
++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ]
++ lib.optionals config.pub-solar.paperless.enable [ "paperless.local" ]
++ lib.optionals cfg.enableHelp [ "help.local" ];
in
{
"127.0.0.1" = hostnames;
"::1" = hostnames;
};
# Caddy reverse proxy for local services like cups
@ -67,6 +73,15 @@ in
}
'')
(lib.optionalString
config.pub-solar.paperless.enable
''
paperless.local:80 {
request_header Host localhost:28981
reverse_proxy localhost:28981
}
'')
(lib.optionalString
cfg.enableHelp
''

View file

@ -23,15 +23,15 @@ in
};
config = mkIf cfg.enable {
services.paperless-ng = {
services.paperless = {
enable = true;
user = psCfg.user.name;
consumptionDir = cfg.consumptionDir;
extraConfig = {
PAPERLESS_OCR_LANGUAGE = cfg.ocrLanguage;
PAPERLESS_ADMIN_USER = psCfg.user.name;
PAPERLESS_AUTO_LOGIN_USERNAME = psCfg.user.name;
};
};
environment.systemPackages = [
pkgs.hplip
];
};
}

View file

@ -30,7 +30,10 @@ in
];
};
paperless.enable = true;
paperless = {
enable = false;
ocrLanguage = "nld+deu";
};
arduino.enable = true;
email.enable = true;
uhk.enable = true;