]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/ftp/nassime.nix
Add Nassime's website
[perso/Immae/Config/Nix.git] / nixops / modules / websites / ftp / nassime.nix
diff --git a/nixops/modules/websites/ftp/nassime.nix b/nixops/modules/websites/ftp/nassime.nix
new file mode 100644 (file)
index 0000000..69576c0
--- /dev/null
@@ -0,0 +1,50 @@
+{ lib, pkgs, config, myconfig, mylibs, ... }:
+let
+    cfg = config.services.myWebsites.Nassime;
+    varDir = "/var/lib/ftp/nassime";
+    env = myconfig.env.websites.nassime;
+in {
+  options.services.myWebsites.Nassime = {
+    production = {
+      enable = lib.mkEnableOption "enable Nassime's website";
+    };
+  };
+
+  imports = [
+    ../commons/stats.nix
+  ];
+
+  config = lib.mkIf cfg.production.enable {
+    services.myWebsites.commons.stats.enable = true;
+    services.myWebsites.commons.stats.sites = [
+      {
+        name = "nassime.bouya.org";
+        conf = ./nassime_goaccess.conf;
+      }
+    ];
+
+    security.acme.certs."ftp".extraDomains."nassime.bouya.org" = null;
+    security.acme.certs."nassime" = config.services.myCertificates.certConfig // {
+      domain = "nassime.bouya.org";
+    };
+
+    services.myWebsites.production.vhostConfs.nassime = {
+      certName    = "nassime";
+      hosts       = ["nassime.bouya.org" ];
+      root        = varDir;
+      extraConfig = [
+        ''
+        Use Stats nassime.bouya.org
+        ServerAdmin ${env.server_admin}
+
+        <Directory ${varDir}>
+          DirectoryIndex index.php index.htm index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride None
+          Require all granted
+        </Directory>
+          ''
+      ];
+    };
+  };
+}