49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
# document management system
|
|
{ config, lib, ... }:
|
|
let
|
|
cfg = config.my.profiles.paperless;
|
|
hostName = config.networking.hostName;
|
|
in
|
|
{
|
|
options.my.profiles.paperless = with lib; {
|
|
enable = mkEnableOption "Paperless Server";
|
|
|
|
port = mkOption {
|
|
type = types.port;
|
|
default = 28981;
|
|
example = 8080;
|
|
description = "Internal port for webui";
|
|
};
|
|
|
|
extraConfig = mkOption {
|
|
type = types.attrs;
|
|
default = { };
|
|
example = {
|
|
PAPERLESS_OCR_LANGUAGE = "deu+eng";
|
|
};
|
|
description = "Extra configuration options";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.paperless = {
|
|
enable = true;
|
|
address = "0.0.0.0";
|
|
port = cfg.port;
|
|
# settings = cfg.extraConfig;
|
|
};
|
|
|
|
my.homepage.services = [
|
|
{
|
|
group = "Documents";
|
|
name = "Paperless";
|
|
description = "Document management";
|
|
href = "http://${hostName}:${toString cfg.port}";
|
|
icon = "paperless-ngx.png";
|
|
}
|
|
];
|
|
|
|
networking.firewall.allowedTCPPorts = [ cfg.port ];
|
|
};
|
|
}
|