commit c585c27b98d341891368e49c6e4c37858a0253f0 parent 2c482ec4e5641dfe53e8507c9c420aedcb4b12bf Author: mtmn <miro@haravara.org> Date: Sat, 25 Apr 2026 23:55:21 +0200 nixaran: install radicale Diffstat:
| M | hosts/nixaran/configuration.nix | | | 0 | |
| A | modules/services/radicale.nix | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
| M | secrets.nix | | | 1 | + |
| A | secrets/radicale-htpasswd.age | | | 0 |
4 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/hosts/nixaran/configuration.nix b/hosts/nixaran/configuration.nix Binary files differ. diff --git a/modules/services/radicale.nix b/modules/services/radicale.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + ... +}: let + cfg = config.services.haravara.radicale; + port = 5232; +in { + options.services.haravara.radicale = { + enable = lib.mkEnableOption "Radicale CalDAV/CardDAV server"; + domain = lib.mkOption { + type = lib.types.str; + }; + }; + + config = lib.mkIf cfg.enable { + age.secrets.radicale-htpasswd = { + file = ../../secrets/radicale-htpasswd.age; + owner = "radicale"; + }; + + services.radicale = { + enable = true; + settings = { + server.hosts = ["127.0.0.1:${toString port}"]; + auth = { + type = "htpasswd"; + htpasswd_filename = config.age.secrets.radicale-htpasswd.path; + htpasswd_encryption = "bcrypt"; + }; + storage.filesystem_folder = "/var/lib/radicale/collections"; + }; + }; + + services.caddy.virtualHosts."${cfg.domain}".extraConfig = '' + reverse_proxy 127.0.0.1:${toString port} + ''; + }; +} diff --git a/secrets.nix b/secrets.nix @@ -18,4 +18,5 @@ in { "secrets/mpd-host.age".publicKeys = allKeys; "secrets/corpus.age".publicKeys = allKeys; "secrets/smtp-alerts-password.age".publicKeys = allKeys; + "secrets/radicale-htpasswd.age".publicKeys = allKeys; } diff --git a/secrets/radicale-htpasswd.age b/secrets/radicale-htpasswd.age Binary files differ.