2022-04-04 19:11:22 +00:00
|
|
|
# SPDX-FileCopyrightText: 2022 Luke Granger-Brown <depot@lukegb.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2022-04-06 10:49:52 +00:00
|
|
|
{ depot, pkgs, config, lib, ... }:
|
2022-04-04 19:11:22 +00:00
|
|
|
let
|
|
|
|
inherit (depot.ops) secrets;
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
../lib/bvm.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
# Networking!
|
|
|
|
networking = {
|
|
|
|
hostName = "bvm-paperless";
|
|
|
|
hostId = "c8d6f81f";
|
|
|
|
|
|
|
|
interfaces.enp1s0 = {
|
|
|
|
ipv4.addresses = [{ address = "10.100.0.211"; prefixLength = 23; }];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
my.ip.tailscale = "100.85.236.121";
|
2022-09-01 23:22:16 +00:00
|
|
|
my.ip.tailscale6 = "fd7a:115c:a1e0:ab12:4843:cd96:6255:ec79";
|
2022-04-04 19:11:22 +00:00
|
|
|
|
2022-04-15 22:33:53 +00:00
|
|
|
services.paperless = {
|
2022-04-05 23:57:22 +00:00
|
|
|
enable = true;
|
2022-09-11 21:50:08 +00:00
|
|
|
address = "[${config.my.ip.tailscale6}]";
|
2022-04-05 23:57:22 +00:00
|
|
|
extraConfig = {
|
2022-06-29 20:39:56 +00:00
|
|
|
PAPERLESS_URL = "https://paperless.int.lukegb.com";
|
2022-04-06 10:49:52 +00:00
|
|
|
PAPERLESS_ALLOWED_HOSTS = "paperless.int.lukegb.com,bvm-paperless.int.as205479.net:28981,bvm-paperless.int.as205479.net";
|
|
|
|
PAPERLESS_CORS_ALLOWED_HOSTS = "https://paperless.int.lukegb.com,http://bvm-paperless.int.as205479.net:28981";
|
2022-06-29 20:39:56 +00:00
|
|
|
PAPERLESS_CSRF_TRUSTED_ORIGINS = "https://paperless.int.lukegb.com,http://bvm-paperless.int.as205479.net:28981";
|
2022-04-05 23:57:22 +00:00
|
|
|
PAPERLESS_ENABLE_HTTP_REMOTE_USER = "true";
|
2022-06-19 20:21:15 +00:00
|
|
|
PAPERLESS_DBHOST = "/run/postgresql";
|
2022-06-19 19:59:51 +00:00
|
|
|
PAPERLESS_DBPASS = "";
|
2022-04-05 23:57:22 +00:00
|
|
|
};
|
|
|
|
};
|
2022-04-15 22:33:53 +00:00
|
|
|
systemd.services.paperless-scheduler.serviceConfig = {
|
2022-04-06 10:49:52 +00:00
|
|
|
RestrictAddressFamilies = lib.mkForce [];
|
|
|
|
SystemCallFilter = lib.mkForce [];
|
|
|
|
PrivateNetwork = lib.mkForce false;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
ensureUsers = [{
|
|
|
|
name = "paperless";
|
|
|
|
ensurePermissions = {
|
|
|
|
"DATABASE paperless" = "ALL PRIVILEGES";
|
|
|
|
};
|
|
|
|
}];
|
|
|
|
ensureDatabases = [ "paperless" ];
|
|
|
|
};
|
2022-04-05 23:57:22 +00:00
|
|
|
|
2022-04-04 19:11:22 +00:00
|
|
|
system.stateVersion = "22.05";
|
|
|
|
}
|