mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-27 06:10:53 +01:00
Added paperless service
This commit is contained in:
parent
f01fd4e8ca
commit
37799b141b
2 changed files with 70 additions and 0 deletions
|
@ -18,6 +18,11 @@ in
|
|||
enable = true;
|
||||
subdomain = "cloud";
|
||||
};
|
||||
paperless = {
|
||||
enable = true;
|
||||
nginx.enable = true;
|
||||
nginx.subdomain = "papers";
|
||||
};
|
||||
zfs-mails.enable = true;
|
||||
zfs-mails.name = hostName;
|
||||
zfs-mails.smart.enable = true;
|
||||
|
@ -33,6 +38,25 @@ in
|
|||
services.zfs.autoSnapshot.enable = true;
|
||||
services.zfs.autoScrub.enable = true;
|
||||
|
||||
|
||||
networking.wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.10/24" ];
|
||||
listenPort = 51820;
|
||||
privateKeyFile = "/root/wireguard-keys/private";
|
||||
|
||||
peers = [
|
||||
{
|
||||
allowedIPs = [ "10.100.0.0/24" ];
|
||||
publicKey = "hz+h9Oque5h+Y/WzOUnai3e9UfIfDsvtqmQH0xycIzs=";
|
||||
endpoint = "212.129.40.11:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
system.stateVersion = "21.05";
|
||||
|
||||
}
|
||||
|
|
46
modules/paperless/default.nix
Normal file
46
modules/paperless/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.luj.jackett;
|
||||
port = 28981;
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.jackett = {
|
||||
enable = mkEnableOption "activate paperless service";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "paperless";
|
||||
description = "User account under which Paperless runs.";
|
||||
};
|
||||
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.paperless-ng = {
|
||||
enable = true;
|
||||
user = cfg.user;
|
||||
mediaDir = "/home/julien/papers";
|
||||
extraConfig = {
|
||||
PAPERLESS_OCR_LANGUAGE = "fre+eng";
|
||||
PAPERLESS_OCR_MODE = "redo";
|
||||
PAPERLESS_TIME_ZONE = "Europe/Paris";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
(mkIf cfg.nginx.enable (mkVPNSubdomain cfg.nginx.subdomain port))]);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue