Use NixNG for Radicale

This commit is contained in:
Pim Kunis 2024-12-17 23:02:06 +01:00
parent a741e523a0
commit 7fdc63502a
4 changed files with 67 additions and 58 deletions

View file

@ -1,5 +1,7 @@
{
self,
config,
utils,
lib,
globals,
...
@ -8,39 +10,6 @@
config = lib.mkIf config.radicale.enable {
kubernetes.resources = {
configMaps.server.data = {
users = "pim:$apr1$GUiTihkS$dDCkaUxFx/O86m6NCy/yQ.";
config = lib.generators.toINI {} {
server = {
hosts = "0.0.0.0:5232, [::]:5232";
ssl = false;
};
encoding = {
request = "utf-8";
stock = "utf-8";
};
auth = {
realm = "Radicale - Password Required";
type = "htpasswd";
htpasswd_filename = "/config/users";
htpasswd_encryption = "md5";
};
rights.type = "owner_only";
storage = {
type = "multifilesystem";
filesystem_folder = "/data";
};
logging = {};
headers = {};
};
};
deployments.server.spec = {
selector.matchLabels.app = "radicale";
@ -58,7 +27,7 @@
spec = {
containers.radicale = {
image = globals.images.radicale;
image = utils.nixSnapshotterRef (utils.mkNixNGImage "radicale" "${self}/images/radicale.nix");
ports.web.containerPort = 5232;
imagePullPolicy = "IfNotPresent";
@ -67,28 +36,10 @@
name = "data";
mountPath = "/data";
}
{
name = "config";
mountPath = "/config/config";
subPath = "config";
}
{
name = "config";
mountPath = "/config/users";
subPath = "users";
}
];
};
volumes = {
data.persistentVolumeClaim.claimName = "data";
config.configMap.name = "server";
};
securityContext = {
fsGroup = 2999;
fsGroupChangePolicy = "OnRootMismatch";
};
volumes.data.persistentVolumeClaim.claimName = "data";
};
};
};