mirror of
https://github.com/Noratrieb/nixos.git
synced 2026-03-14 16:26:05 +01:00
better paperless setup
This commit is contained in:
parent
9e40ce29ea
commit
6316591cd7
1 changed files with 24 additions and 2 deletions
|
|
@ -1,11 +1,33 @@
|
||||||
{ lib, pkgs, ... }: {
|
{ lib, pkgs, ... }:
|
||||||
|
let localDir = "/home/nora/.local/share/paperless-ngx"; nasDir = "/mnt/nas/HEY/_Nora/paperless"; in {
|
||||||
|
services.paperless = {
|
||||||
|
enable = true;
|
||||||
|
dataDir = "${localDir}/data";
|
||||||
|
mediaDir = "${localDir}/media";
|
||||||
|
consumptionDir = "${nasDir}/consume";
|
||||||
|
address = "0.0.0.0";
|
||||||
|
port = 8010;
|
||||||
|
user = "nora";
|
||||||
|
environmentFile = "${localDir}/secrets-environment";
|
||||||
|
settings = {
|
||||||
|
PAPERLESS_TIME_ZONE = "Europe/Zurich";
|
||||||
|
PAPERLESS_ADMIN_USER = "nora";
|
||||||
|
PAPERLESS_OCR_LANGUAGE = "deu+eng";
|
||||||
|
};
|
||||||
|
exporter = {
|
||||||
|
enable = true;
|
||||||
|
directory = "${nasDir}/export";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
systemd.services.paperless-ngx-backup = {
|
systemd.services.paperless-ngx-backup = {
|
||||||
description = "paperless-ngx data backup to NAS";
|
description = "paperless-ngx data backup to NAS";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = "nora";
|
User = "nora";
|
||||||
ExecStart = ''
|
ExecStart = ''
|
||||||
${lib.getExe pkgs.rsync} -a -v --delete --exclude=redis /home/nora/.local/share/paperless-ngx/ /mnt/nas/HEY/_Nora/paperless/backup
|
${lib.getExe pkgs.rsync} -a -v --delete --exclude=redis ${localDir}/ ${nasDir}/backup
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue