Files
dotfiles/hosts/hina/services.nix
2024-05-27 23:00:24 +05:30

43 lines
890 B
Nix

{ config, pkgs, lib, conf, ... }:
let
domain = conf.network.addresses.domain.natto;
in
{
services = {
cron.enable = true;
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
ports = [ 22 ];
};
znc = {
enable = true;
mutable = true;
useLegacyConfig = false;
};
nginx = {
enable = true;
virtualHosts = with conf.network.addresses.wireguard.ips; {
"znc.${domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "https://${hina}:9898";
};
};
};
};
};
security.acme = {
acceptTerms = true;
certs = lib.mapAttrs (n: _: { email = "natto@${domain}"; })
(lib.filterAttrs (_: v: v.enableACME) config.services.nginx.virtualHosts);
};
security.pki.certificateFiles = [ ../../cert.pem ];
}