summaryrefslogtreecommitdiff
path: root/profiles/homeserver
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2024-01-09 00:29:30 +0100
committerMike Vink <ivi@vinkies.net>2024-01-09 00:29:30 +0100
commita0f00a52e96f4273f749e16bb791e3cfb34522b8 (patch)
tree800fc2ce3a22e2fca4744a65c1f99c6eebc96695 /profiles/homeserver
parent25d9705750755aeddf093cb5834b385ae3ff8ffc (diff)
add pump
Diffstat (limited to 'profiles/homeserver')
-rw-r--r--profiles/homeserver/acme.nix13
-rw-r--r--profiles/homeserver/nginx.nix21
2 files changed, 34 insertions, 0 deletions
diff --git a/profiles/homeserver/acme.nix b/profiles/homeserver/acme.nix
new file mode 100644
index 0000000..a30e395
--- /dev/null
+++ b/profiles/homeserver/acme.nix
@@ -0,0 +1,13 @@
+{ config, lib, ... }: with lib; {
+ security.acme = {
+ acceptTerms = true;
+ defaults = {
+ # NOTE(ivi): use dns wildcard certs for local services
+ domain = "*.vinkies.net";
+ extraLegoRunFlags = ["--preferred-chain" "ISRG Root X1"];
+ email = ivi.email;
+ dnsProvider = "porkbun";
+ credentialsFile = config.secrets.porkbun.path;
+ };
+ };
+}
diff --git a/profiles/homeserver/nginx.nix b/profiles/homeserver/nginx.nix
new file mode 100644
index 0000000..cd847ba
--- /dev/null
+++ b/profiles/homeserver/nginx.nix
@@ -0,0 +1,21 @@
+{ lib, ... }: with lib; {
+ # apparently you can set defaults on existing modules?
+ options.services.nginx.virtualHosts = mkOption {
+ type = types.attrsOf (types.submodule ({ name, ... }: {
+ config = mkIf (name != "default") {
+ forceSSL = mkDefault true;
+ };
+ }));
+ };
+ config = {
+ services.nginx = {
+ enable = true;
+ enableReload = true;
+ recommendedTlsSettings = true;
+ recommendedProxySettings = true;
+ recommendedGzipSettings = true;
+ recommendedOptimisation = true;
+ };
+ networking.firewall.allowedTCPPorts = [ 80 443 ];
+ };
+}