nixos-servers/kubenix-modules/paperless-ngx.nix

146 lines
3.6 KiB
Nix
Raw Normal View History

2024-03-29 12:50:51 +00:00
{
kubernetes.resources = {
configMaps.paperless-ngx.data = {
PAPERLESS_REDIS = "redis://paperless-ngx-redis.default.svc.cluster.local:6379";
2024-03-29 12:50:51 +00:00
PAPERLESS_DBENGINE = "postgresql";
PAPERLESS_DBHOST = "lewis.dmz";
PAPERLESS_DBNAME = "paperless";
PAPERLESS_DBUSER = "paperless";
PAPERLESS_DATA_DIR = "/data/";
PAPERLESS_MEDIA_ROOT = "/data/";
PAPERLESS_OCR_LANGUAGES = "nld eng";
PAPERLESS_URL = "https://paperless.kun.is";
PAPERLESS_TIME_ZONE = "Europe/Amsterdam";
PAPERLESS_OCR_LANGUAGE = "nld";
USERMAP_UID = "33";
USERMAP_GID = "33";
};
secrets.paperless-ngx.stringData = {
2024-04-14 12:48:27 +00:00
databasePassword = "ref+sops://secrets/sops.yaml#/paperless-ngx/databasePassword";
secretKey = "ref+sops://secrets/sops.yaml#/paperless-ngx/secretKey";
2024-03-29 12:50:51 +00:00
};
deployments = {
paperless-ngx-web = {
metadata.labels = {
app = "paperless-ngx";
component = "web";
};
2024-03-29 12:50:51 +00:00
spec = {
selector.matchLabels = {
app = "paperless-ngx";
component = "web";
};
2024-03-29 12:50:51 +00:00
template = {
metadata.labels = {
app = "paperless-ngx";
component = "web";
};
2024-03-29 12:50:51 +00:00
spec = {
2024-04-14 19:00:15 +00:00
volumes.data.persistentVolumeClaim.claimName = "paperless-ngx-data";
containers.paperless-ngx = {
2024-03-29 12:50:51 +00:00
image = "ghcr.io/paperless-ngx/paperless-ngx:2.3";
envFrom = [{ configMapRef.name = "paperless-ngx"; }];
2024-04-14 19:43:31 +00:00
ports.web.containerPort = 8000;
2024-03-29 12:50:51 +00:00
2024-04-14 19:00:15 +00:00
env = {
PAPERLESS_DBPASS.valueFrom.secretKeyRef = {
name = "paperless-ngx";
key = "databasePassword";
};
PAPERLESS_SECRET_KEY.valueFrom.secretKeyRef = {
name = "paperless-ngx";
key = "secretKey";
};
};
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
2024-03-29 12:50:51 +00:00
};
};
};
};
};
paperless-ngx-redis = {
metadata.labels = {
app = "paperless-ngx";
component = "redis";
};
spec = {
selector.matchLabels = {
app = "paperless-ngx";
component = "redis";
};
template = {
metadata.labels = {
app = "paperless-ngx";
component = "redis";
2024-03-29 12:50:51 +00:00
};
spec = {
2024-04-14 19:00:15 +00:00
volumes.data.persistentVolumeClaim.claimName = "paperless-ngx-redisdata";
containers.redis = {
image = "docker.io/library/redis:7";
2024-04-14 19:43:31 +00:00
ports.redis.containerPort = 6379;
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
};
};
2024-03-29 12:50:51 +00:00
};
};
};
};
services = {
paperless-ngx-web.spec = {
selector = {
app = "paperless-ngx";
component = "web";
};
2024-03-29 12:50:51 +00:00
2024-04-14 19:43:31 +00:00
ports.web = {
port = 80;
2024-04-14 19:43:31 +00:00
targetPort = "web";
};
};
paperless-ngx-redis.spec = {
selector = {
app = "paperless-ngx";
component = "redis";
};
2024-04-14 19:43:31 +00:00
ports.redis = {
port = 6379;
2024-04-14 19:43:31 +00:00
targetPort = "redis";
};
};
2024-03-29 12:50:51 +00:00
};
};
2024-03-29 12:50:51 +00:00
lab = {
ingresses.paperless-ngx = {
host = "paperless.kun.is";
service = {
name = "paperless-ngx-web";
portName = "web";
};
};
2024-03-29 12:50:51 +00:00
};
}