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

58
images/radicale.nix Normal file
View file

@ -0,0 +1,58 @@
{
nglib,
nixpkgs,
...
}:
nglib.makeSystem
(let
htpasswd_location = "/radicale_htpasswd";
in {
inherit nixpkgs;
system = "x86_64-linux";
name = "nixng-radicale";
config = {...}: {
dinit.enable = true;
init.services.radicale = {
shutdownOnExit = true;
tmpfiles = with nglib.nottmpfiles.dsl; [
(f htpasswd_location "-" "radicale" "radicale" _ "pim:$apr1$GUiTihkS$dDCkaUxFx/O86m6NCy/yQ.")
];
};
services.radicale = {
enable = true;
settings = {
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 = htpasswd_location;
htpasswd_encryption = "md5";
};
rights.type = "owner_only";
storage = {
type = "multifilesystem";
filesystem_folder = "/data";
};
logging = {};
headers = {};
};
};
};
})