summaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorEthel Morgan <eth@ethulhu.co.uk>2020-07-01 22:36:23 +0100
committerEthel Morgan <eth@ethulhu.co.uk>2020-07-01 22:36:23 +0100
commitdbad6100b446cdcd26e6117bb236bda04e517cf1 (patch)
tree7228bd38183580d0ac9544b3e59dbac6412c497c /nixos
parent52e1994a8314d3dbc1d9f345bd5eddba796109ed (diff)
add eth.sites.recipes
Diffstat (limited to '')
-rw-r--r--nixos/modules/module-list.nix3
-rw-r--r--nixos/modules/sites/recipes.nix32
2 files changed, 34 insertions, 1 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 6225094..0a778ee 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -9,9 +9,10 @@
./programs/steam.nix
./services/ambience.nix
./services/catbus-lgtv.nix
+ ./services/catbus-lifx.nix
./sites/cgit.nix
./sites/go.nix
- ./services/catbus-lifx.nix
+ ./sites/recipes.nix
./services/catbus-networkpresence.nix
./services/catbus-snapcast.nix
./services/catbus-wakeonlan.nix
diff --git a/nixos/modules/sites/recipes.nix b/nixos/modules/sites/recipes.nix
new file mode 100644
index 0000000..2312e56
--- /dev/null
+++ b/nixos/modules/sites/recipes.nix
@@ -0,0 +1,32 @@
+{ config, lib, pkgs, ... }:
+with lib;
+
+let
+ cfg = config.eth.sites.recipes;
+
+in {
+ options.eth.sites.recipes = {
+ enable = mkEnableOption "Whether to enable recipes.";
+
+ https = mkOption {
+ type = types.bool;
+ default = true;
+ description = "Whether to enable HTTPS.";
+ };
+
+ virtualHost = mkOption {
+ type = types.str;
+ default = "_";
+ description = "Virtual Host to install the site under in Nginx.";
+ example = "git.eth.moe";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ services.nginx.virtualHosts.${cfg.virtualHost} = {
+ forceSSL = cfg.https;
+ enableACME = cfg.https;
+ root = "${pkgs.eth.recipes}";
+ };
+ };
+}