Skip to content

Commit

Permalink
Setup radicale
Browse files Browse the repository at this point in the history
  • Loading branch information
peterablehmann committed Aug 19, 2024
1 parent 4312d20 commit 932e1d8
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
uptime-kuma = ./modules/uptime-kuma.nix;
restic-server = ./modules/restic-server;
nextcloud = ./modules/nextcloud.nix;
radicale = ./modules/radicale.nix;
};

dns = (nixos-dns.utils.generate nixpkgs.legacyPackages.x86_64-linux).octodnsConfig {
Expand Down
1 change: 1 addition & 0 deletions modules/radicale/.htpasswd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
peter:$2y$05$VTYDhx/eNscApKaHCAEuG.AiFb2/K77Lpwwe7szdDYcnd5d9SyXPe
48 changes: 48 additions & 0 deletions modules/radicale/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ config
, ...
}:
let
domain = "radicale.xnee.net";
tls-dir = config.security.acme.certs.${domain}.directory;
in
{
networking.domains.subDomains.${domain} = { };
security.acme.certs.${domain} = { };
services.nginx.virtualHosts."${domain}" = {
useACMEHost = domain;
forceSSL = true;
locations."/" = {
proxyPass = "https://${builtins.elemAt config.services.radicale.settings.server.hosts 0}";
};
};

systemd.services.radicale = {
serviceConfig = {
SupplementaryGroups = [ config.security.acme.certs.${domain}.group ];
BindReadOnlyPaths = [ tls-dir ];
};
};

services.radicale = {
enable = true;
settings = {
server = {
hosts = [ "[::1]:5232" ];
ssl = true;
certificate = "${tls-dir}/fullchain.pem";
key = "${tls-dir}/key.pem";
};
auth = {
type = "htpasswd";
htpasswd_filename = "${./.htpasswd}";
htpasswd_encryption = "bcrypt";
};
rights.type = "owner_only";
storage = {
type = "multifilesystem";
filesystem_folder = "/var/lib/radicale/collections";
};
};
};
backup.paths = [ config.services.radicale.settings.storage.filesystem_folder ];
}
1 change: 1 addition & 0 deletions nodes/ymir/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
inputs.self.nixosModules.kanidm
inputs.self.nixosModules.keycloak
inputs.self.nixosModules.paperless
inputs.self.nixosModules.radicale
];
}

0 comments on commit 932e1d8

Please sign in to comment.