diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
commit | 9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch) | |
tree | f28beec29deeea36038615a8fb98a810891940b5 /modules/nixos/radicale.nix | |
parent | 2024-03-19 (diff) |
2024-03-31
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/radicale.nix | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/modules/nixos/radicale.nix b/modules/nixos/radicale.nix index 588ed51..59fb4a2 100644 --- a/modules/nixos/radicale.nix +++ b/modules/nixos/radicale.nix @@ -5,9 +5,11 @@ libNginx, ... }: -with lib; let +with lib; +let cfg = config.nixfiles.modules.radicale; -in { +in +{ options.nixfiles.modules.radicale = { enable = mkEnableOption "Radicale"; @@ -18,11 +20,12 @@ in { }; }; - config = let - port = 5232; - in + config = + let + port = 5232; + in mkIf cfg.enable { - ark.directories = ["/var/lib/radicale"]; + ark.directories = [ "/var/lib/radicale" ]; secrets.radicale-htpasswd = { file = "${inputs.self}/secrets/radicale-htpasswd"; @@ -32,7 +35,7 @@ in { nixfiles.modules.nginx = { enable = true; - upstreams.radicale.servers."127.0.0.1:${toString port}" = {}; + upstreams.radicale.servers."127.0.0.1:${toString port}" = { }; virtualHosts.${cfg.domain} = { locations."/".proxyPass = "http://radicale"; extraConfig = libNginx.config.internalOnly; @@ -42,7 +45,7 @@ in { services.radicale = { enable = true; settings = { - server.hosts = ["127.0.0.1:${toString port}"]; + server.hosts = [ "127.0.0.1:${toString port}" ]; web.type = "none"; auth = { type = "htpasswd"; |