summaryrefslogtreecommitdiff
path: root/nixos/sites/default.nix
diff options
context:
space:
mode:
authorEthel Morgan <eth@ethulhu.co.uk>2020-07-11 13:39:11 +0100
committerEthel Morgan <eth@ethulhu.co.uk>2020-07-11 13:39:11 +0100
commitd9912da7df0b22806cdf8fbe684a67c5a52914fd (patch)
tree3d508456c40fdaac0652f11cb57d71422cfdae88 /nixos/sites/default.nix
parent6d189cabb27e81323881073c91714a7410efc8c3 (diff)
add more sites.* nginx convenience functions
Diffstat (limited to 'nixos/sites/default.nix')
-rw-r--r--nixos/sites/default.nix26
1 files changed, 25 insertions, 1 deletions
diff --git a/nixos/sites/default.nix b/nixos/sites/default.nix
index 1ddd148..95d8055 100644
--- a/nixos/sites/default.nix
+++ b/nixos/sites/default.nix
@@ -1,10 +1,34 @@
{ pkgs, ... }:
{
+ catbus-web-ui = pkgs.callPackage ./catbus-web-ui.nix {};
+
https = site: site // {
forceSSL = true;
enableACME = true;
};
- catbus-web-ui = pkgs.callPackage ./catbus-web-ui.nix {};
+ static = root: {
+ locations = {
+ "/" = {
+ root = root;
+ };
+ };
+ };
+
+ proxyACME = remoteHost: {
+ locations = {
+ "/.well-known/acme-challenge/" = {
+ proxyPass = "http://${remoteHost}";
+ };
+ };
+ };
+
+ proxySocket = socketPath: {
+ locations = {
+ "/" = {
+ proxyPass = "http://unix:/${socketPath}";
+ };
+ };
+ };
}