configure cloudflare dns and wildcard nginx

This commit is contained in:
2025-04-23 15:13:07 -05:00
parent 59ac4f3deb
commit 795b55f47e
3 changed files with 55 additions and 4 deletions
+34 -3
View File
@@ -9,11 +9,16 @@
# Secret Management
sops = {
age.keyFile = "./age/keys.txt"; # Make sure to gitignore, contains private key.
defaultSopsFile = ./secrets/build.json;
defaultSopsFormat = "json";
secrets."clusterPassword" = { };
secrets = {
"clusterPassword" = {
sopsFile = ./secrets/build.json;
};
"cloudflare-credentials" = {
sopsFile = ./secrets/cloudflare.json;
};
};
};
systemd.user.services.mbsync.unitConfig.After = [ "sops-nix.service" ];
@@ -21,6 +26,32 @@
environment.variables = {
SECRETKEY = "${config.sops.secrets."clusterPassword".path}";
};
# set up DNS with nginx
security.acme = {
acceptTerms = true;
defaults = {
email = "roydumblauskas@gmail.com";
dnsProvider = "cloudflare";
credentialsFile = config.sops.secrets."cloudflare-credentials".path;
};
};
services.nginx = {
enable = true;
virtualHosts = {
"roypository.com" = {
forceSSL = true;
enableACME = true;
addSSL = true;
};
"*.roypository.com" = {
forceSSL = true;
enableACME = true;
addSSL = true;
};
};
};
# Grub Boot Loader Setup
boot.loader.grub = {