mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
radicale: Init module
This commit is contained in:
parent
391081fe8e
commit
eb4b41222d
3 changed files with 59 additions and 2 deletions
44
modules/system/services/radicale.nix
Normal file
44
modules/system/services/radicale.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.services.radicale;
|
||||
in
|
||||
{
|
||||
options.custom.services.radicale = {
|
||||
enable = lib.mkEnableOption "";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 5232;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
meta = {
|
||||
domains.list = [ cfg.domain ];
|
||||
ports.list = [ cfg.port ];
|
||||
};
|
||||
|
||||
sops = {
|
||||
secrets."radicale/admin-password".owner = config.users.users.radicale.name;
|
||||
templates."radicale/htpasswd" = {
|
||||
owner = config.users.users.radicale.name;
|
||||
content = "seb:${config.sops.placeholder."radicale/admin-password"}";
|
||||
};
|
||||
};
|
||||
|
||||
services.radicale = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server.hosts = "localhost:${builtins.toString cfg.port}";
|
||||
auth = {
|
||||
type = "htpasswd";
|
||||
htpasswd_filename = config.sops.templates."radicale/htpasswd".path;
|
||||
htpasswd_encryption = "plain";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue