From d428a9bb41495574a580d42014b604ee810d0ed1 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Jun 2024 12:53:00 +0200 Subject: [PATCH] pastila: srv --- pastila/configuration.nix | 1 + pastila/srv.nix | 27 +++++++++++++++++++++++++++ vars.nix | 1 + 3 files changed, 29 insertions(+) create mode 100644 pastila/srv.nix diff --git a/pastila/configuration.nix b/pastila/configuration.nix index d30bd16..d96133d 100644 --- a/pastila/configuration.nix +++ b/pastila/configuration.nix @@ -12,6 +12,7 @@ in ./users.nix ./gitolite.nix ./letsencrypt.nix + ./srv.nix ]; # Use the GRUB 2 boot loader. diff --git a/pastila/srv.nix b/pastila/srv.nix new file mode 100644 index 0000000..fead6da --- /dev/null +++ b/pastila/srv.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + services.nginx.enable = true; + + users.users."up" = { + isNormalUser = true; + group = config.services.nginx.group; + createHome = true; + }; + + services.nginx.virtualHosts."srv.isomorphis.me" = { + forceSSL = true; + enableACME = true; + root = config.users.users."up".home; + locations."/" = { + extraConfig = '' + autoindex on; + ''; + }; + locations."/i/" = { + extraConfig = '' + autoindex off; + ''; + }; + }; +} \ No newline at end of file diff --git a/vars.nix b/vars.nix index 9998448..4017fd3 100644 --- a/vars.nix +++ b/vars.nix @@ -6,6 +6,7 @@ # ports to open on pastila and forward through the NAT in oven forwardPorts = [ { num = 80; proto = "tcp"; } + { num = 443; proto = "tcp"; } { num = 22; proto = "tcp"; } ]; };