mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
Using ./home.nix and ./nixos.nix as entrypoints for hosts. Using hardware profiles. Using new entrypoints (profiles/base/profiles.nix + profiles/base/home.nix). New modules (for DNS handling, for themeing, ...). Split up deploy-tf.nix into several modules. Renamed common profile to base profile.
43 lines
1 KiB
Nix
43 lines
1 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
mailAccounts = config.mailserver.loginAccounts;
|
|
htpasswd = pkgs.writeText "radicale.users" (concatStrings
|
|
(flip mapAttrsToList mailAccounts
|
|
(mail: user: mail + ":" + user.hashedPassword + "\n")));
|
|
in
|
|
{
|
|
services.radicale = {
|
|
enable = true;
|
|
settings = {
|
|
auth = {
|
|
type = "htpasswd";
|
|
htpasswd_filename = toString htpasswd;
|
|
htpasswd_encryption = "bcrypt";
|
|
};
|
|
};
|
|
};
|
|
|
|
services.nginx.virtualHosts = {
|
|
"cal.${config.kw.dns.domain}" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:5232/";
|
|
extraConfig = ''
|
|
proxy_set_header X-Script-Name /;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_pass_header Authorization;
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
deploy.tf.dns.records.services_radicale = {
|
|
tld = config.kw.dns.tld;
|
|
domain = "cal";
|
|
cname.target = "${config.networking.hostName}.${config.kw.dns.tld}";
|
|
};
|
|
}
|