Files
dotfiles/hosts/hina/services.nix
Amneesh Singh d4554d43ae hosts/hina: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-08-16 13:44:42 +05:30

43 lines
881 B
Nix

{ config, pkgs, lib, lib', ... }:
let
domain = lib'.network.addresses.domain.natto;
in
{
services = {
cron.enable = true;
openssh = {
enable = true;
permitRootLogin = "yes";
ports = [ 22 ];
};
znc = {
enable = true;
mutable = true;
useLegacyConfig = false;
};
nginx = {
enable = true;
virtualHosts = with lib'.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 ];
}