From f12a00b045de6da16662d238385bdf7838258600 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Thu, 1 Dec 2022 15:51:08 +0100 Subject: [PATCH] wip: expose websites via nginx --- system/hosts/sail.nix | 2 ++ system/nixos/websites.nix | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 system/nixos/websites.nix diff --git a/system/hosts/sail.nix b/system/hosts/sail.nix index e1b92f2..057ed97 100644 --- a/system/hosts/sail.nix +++ b/system/hosts/sail.nix @@ -17,6 +17,8 @@ in (import ../nixos/synapse.nix (args // { inherit secret; })) + ../nixos/websites.nix + (import ../nixos/tailscale.nix (args // { inherit secret; })) ../nixos/arion.nix diff --git a/system/nixos/websites.nix b/system/nixos/websites.nix new file mode 100644 index 0000000..09bed06 --- /dev/null +++ b/system/nixos/websites.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = [ pkgs.website-docs-nifoc-pw ]; + + services.nginx = { + enable = true; + + # Documentation + virtualHosts = builtins.listToAttrs builtins.map + (domain: { + name = domain; + value = { + root = "${pkgs.website-docs-nifoc-pw}/site/${domain}"; + extraConfig = '' + autoindex on; + autoindex_format html; + ''; + }; + }) [ "katja.nifoc.pw" ]; + }; + + networking.firewall.allowedTCPPorts = [ 80 ]; +}