about summary refs log tree commit diff
path: root/users/wpcarro/nixos/diogenes/default.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2022-06-28T17·32-0700
committerclbot <clbot@tvl.fyi>2022-06-28T17·37+0000
commit6d99b93f1a45cff91f369dc7c53bdc724d68d092 (patch)
tree1fba73ff518d96c9f4b4d63afd6bd702866c3d66 /users/wpcarro/nixos/diogenes/default.nix
parentab1984c8ac07fea86d1779956fd4f9ebfbb91b9e (diff)
feat(wpcarro/website): Support SSL certs for wpcarro.dev r/4264
This has been sloppy for awhile...

While I'm at it modularize some of my Nginx configuration.

Side note: might be time to decouple the Terraform provisioning stuffs from the
NixOS configuration, and this feels *too* tightly coupled.

Change-Id: Ida0da5462d938b956571321a67ba1f026fb0a7de
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5902
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/wpcarro/nixos/diogenes/default.nix')
-rw-r--r--users/wpcarro/nixos/diogenes/default.nix44
1 files changed, 7 insertions, 37 deletions
diff --git a/users/wpcarro/nixos/diogenes/default.nix b/users/wpcarro/nixos/diogenes/default.nix
index 022570e3d315..e83329e4c266 100644
--- a/users/wpcarro/nixos/diogenes/default.nix
+++ b/users/wpcarro/nixos/diogenes/default.nix
@@ -4,6 +4,9 @@ let
   inherit (depot.users) wpcarro;
   name = "diogenes";
   domainName = "billandhiscomputer.com";
+
+  mod = name: depot.path.origSrc + ("/ops/modules/" + name);
+  usermod = name: depot.path.origSrc + ("/users/wpcarro/nixos/modules/" + name);
 in
 wpcarro.terraform.googleCloudVM {
   project = "wpcarros-infrastructure";
@@ -36,7 +39,10 @@ wpcarro.terraform.googleCloudVM {
 
   configuration = {
     imports = [
-      (depot.path.origSrc + "/ops/modules/quassel.nix")
+      (mod "quassel.nix")
+      (usermod "nginx.nix")
+      (usermod "www/billandhiscomputer.com.nix")
+      (usermod "www/wpcarro.dev.nix")
     ];
 
     networking = {
@@ -117,42 +123,6 @@ wpcarro.terraform.googleCloudVM {
         googleCloudProject = "wpcarros-infrastructure";
         applicationCredentials = "/etc/gcp/key.json";
       };
-
-      nginx = {
-        enable = true;
-        enableReload = true;
-
-        recommendedTlsSettings = true;
-        recommendedGzipSettings = true;
-        recommendedProxySettings = true;
-
-        # for journaldriver
-        commonHttpConfig = ''
-          log_format json_combined escape=json
-          '{'
-              '"remote_addr":"$remote_addr",'
-              '"method":"$request_method",'
-              '"host":"$host",'
-              '"uri":"$request_uri",'
-              '"status":$status,'
-              '"request_size":$request_length,'
-              '"response_size":$body_bytes_sent,'
-              '"response_time":$request_time,'
-              '"referrer":"$http_referer",'
-              '"user_agent":"$http_user_agent"'
-          '}';
-
-          access_log syslog:server=unix:/dev/log,nohostname json_combined;
-        '';
-
-        virtualHosts = {
-          "${domainName}" = {
-            addSSL = true;
-            enableACME = true;
-            root = wpcarro.website.root;
-          };
-        };
-      };
     };
 
     system.stateVersion = "21.11";