diff --git a/hosts/chocolatebar/chocolatebar.nix b/hosts/chocolatebar/chocolatebar.nix index bb13dce9..28be767e 100644 --- a/hosts/chocolatebar/chocolatebar.nix +++ b/hosts/chocolatebar/chocolatebar.nix @@ -29,6 +29,7 @@ in wayvnc drone-docker-runner stdenv.cc.cc.lib + pkgs.hplip ]; age.secrets."vnc-key.pem" = { diff --git a/modules/core/networking.nix b/modules/core/networking.nix index c5ec9cbe..5d66bc56 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -43,12 +43,18 @@ in nix.binaryCachePublicKeys = cfg.publicKeys; # These entries get added to /etc/hosts - networking.hosts = { - "127.0.0.1" = [ ] - ++ lib.optionals cfg.enableCaddy [ "caddy.local" ] - ++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ] - ++ lib.optionals cfg.enableHelp [ "help.local" ]; - }; + 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 services.caddy = { @@ -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 '' diff --git a/modules/paperless/default.nix b/modules/paperless/default.nix index 9fd22ab4..d8b1edda 100644 --- a/modules/paperless/default.nix +++ b/modules/paperless/default.nix @@ -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 - ]; }; } diff --git a/users/ben/default.nix b/users/ben/default.nix index ce609813..1cb6f5d7 100644 --- a/users/ben/default.nix +++ b/users/ben/default.nix @@ -30,7 +30,10 @@ in ]; }; - paperless.enable = true; + paperless = { + enable = false; + ocrLanguage = "nld+deu"; + }; arduino.enable = true; email.enable = true; uhk.enable = true;