mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
paperless: migrate as module
This commit is contained in:
parent
04bf033484
commit
2251c22311
2 changed files with 57 additions and 21 deletions
57
modules/services/paperless/default.nix
Normal file
57
modules/services/paperless/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
# document management system
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.services.paperless;
|
||||
domain = config.networking.domain;
|
||||
in
|
||||
{
|
||||
options.my.services.paperless = with lib; {
|
||||
enable = mkEnableOption "Paperless Server";
|
||||
|
||||
passwordFile = mkOption {
|
||||
type = types.path;
|
||||
description = "Password for the defaultUser for FreshRSS.";
|
||||
example = "/run/secrets/freshrss";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 28981;
|
||||
example = 8080;
|
||||
description = "Internal port for webui";
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
description = "additional extraConfig";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.paperless = {
|
||||
enable = true;
|
||||
inherit (cfg) port;
|
||||
mediaDir = "/srv/data/docs";
|
||||
extraConfig = {
|
||||
PAPERLESS_OCR_LANGUAGE = "deu+eng";
|
||||
} // cfg.extraConfig;
|
||||
};
|
||||
|
||||
my.services.nginx.virtualHosts = [
|
||||
{
|
||||
subdomain = "docs";
|
||||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
webapps.apps.paperless = {
|
||||
dashboard = {
|
||||
name = "Paperless";
|
||||
category = "media";
|
||||
icon = "book";
|
||||
link = "https://docs.${domain}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
sops.secrets.paperless_password = { };
|
||||
|
||||
services.paperless = {
|
||||
enable = true;
|
||||
passwordFile = config.sops.secrets.paperless_password.path;
|
||||
mediaDir = "/srv/data/docs";
|
||||
extraConfig = {
|
||||
PAPERLESS_OCR_LANGUAGE = "deu+eng";
|
||||
};
|
||||
};
|
||||
webapps.apps.paperless = {
|
||||
dashboard = {
|
||||
name = "Paperless";
|
||||
category = "app";
|
||||
icon = "book";
|
||||
link = "https://docs.buehler.rocks";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue