attempt to write paperless config

This commit is contained in:
Clara Dautermann 2025-03-15 18:58:55 +01:00
parent 90fc470aa7
commit 61cfdd25e7
3 changed files with 74 additions and 1 deletions

View file

@ -3,11 +3,19 @@
time.timeZone = "Europe/Berlin";
# we want at least a possibility to download stuff, monitor activity and sudo
environment.systemPackages = with pkgs; [
wget
htop
sudo
];
# because getting a nix shell is super annoying otherwise
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# zsh because I like it :3
programs.zsh.enable = true;

View file

@ -0,0 +1,51 @@
{ lib, pkgs, config, ... }:
let
dbname = "paperless";
dbuser = "paperless";
dbpass = "paperless";
in
{
services.paperless = {
enable = true;
consumptionDirIsPublic = true;
address = "192.168.178.51";
user = dbuser;
settings = {
PAPERLESS_CONSUMER_IGNORE_PATTERN = [
".DS_STORE/*"
"desktop.ini"
];
PAPERLESS_OCR_LANGUAGE = "deu+eng";
PAPERLESS_TIME_ZONE = "Europe/Berlin";
PAPERLESS_CONSUMER_ENABLE_BARCODES = true;
PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE = true;
PAPERLESS_CONSUMER_BARCODE_SCANNER = "ZXING";
PAPERLESS_OCR_USER_ARGS = {
optimize = 1;
pdfa_image_compression = "lossless";
};
PAPERLESS_DBENGINE = "postgres";
PAPERLESS_DBHOST = "/run/postgresql";
PAPERLESS_DUSER = dbuser;
PAPERLESS_DBNAME = dbname;
PAPERLESS_DBPASS = dbpass;
};
};
# enable a PostgreSQL DB
services.postgresql = {
enable = true;
ensureDatabases = [ dbname ];
ensureUsers = [{
name = dbuser;
ensureDBOwnership = true;
}];
};
# Paperless-ngx also requires a redis cache
services.redis.enable = true;
# 28981 is the default paperless web port
networking.firewall.allowedTCPPorts = [ 28981 ];
}