aboutsummaryrefslogtreecommitdiff
path: root/nix/web.nix
diff options
context:
space:
mode:
authorAlexander Kassouni <alex@kassouni.net>2026-09-29 23:29:28 -0700
committerAlexander Kassouni <alex@kassouni.net>2026-09-29 23:29:28 -0700
commit52cdeaf4cc9da9d32926821c78fd331bc8d2f14a (patch)
tree1b57b1c4d7c4e70202d9f07bab8a8e1a477078b9 /nix/web.nix
parenta570da443586fa3b3490b5add88ea5932456a5b3 (diff)
restructure for cgit css
Diffstat (limited to 'nix/web.nix')
-rw-r--r--nix/web.nix36
1 files changed, 30 insertions, 6 deletions
diff --git a/nix/web.nix b/nix/web.nix
index b34f8d8..0013d4f 100644
--- a/nix/web.nix
+++ b/nix/web.nix
@@ -1,8 +1,32 @@
-{...}: {
- # dont serve git.kassouni.net traffic to other subdomains
- services.nginx.virtualHosts."_" = {
- default = true;
- rejectSSL = true;
- locations."/".return = 444;
+{inputs, pkgs, ...}: let
+ domain = "kassouni.net";
+in {
+ services.nginx = {
+ enable = true;
+ recommendedGzipSettings = true;
+ recommendedOptimisation = true;
+ recommendedTlsSettings = true;
+
+ virtualHosts = {
+ # dont serve kassouni.net traffic to other subdomains
+ "_" = {
+ default = true;
+ rejectSSL = true;
+ locations."/".return = 444;
+ };
+
+ ${domain} = {
+ forceSSL = true;
+ enableACME = true;
+ root = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.website;
+ };
+ };
};
+
+ security.acme = {
+ acceptTerms = true;
+ defaults.email = "alex@${domain}";
+ };
+
+ networking.firewall.allowedTCPPorts = [ 80 443 ];
}