initrd: add comments
[sourcephile-nix.git] / hosts / mermet / nginx / sourcephile.fr / www.nix
index 73300c9a5e01d4ac6fdb57e08c8e82524ecc0bb6..5989030b188486b0f507d58582f90488445867ba 100644 (file)
@@ -1,44 +1,47 @@
 { domain, ... }:
-{ pkgs, lib, config, inputs, hostName, ... }:
+{ lib, config, ... }:
 let
-  inherit (config) networking;
   inherit (config.services) nginx;
   srv = "www";
   root = "/var/lib/nginx/${domain}";
 in
 {
-systemd.services.nginx.serviceConfig = {
-  BindPaths = [
-    "/home/julm/work/sourcephile/txt:${root}/${srv}"
-  ];
-  StateDirectory = [
-    "nginx/${domain}/${srv}"
-  ];
-  LogsDirectory = lib.mkForce [
-    "nginx/${domain}/${srv}"
-  ];
-};
-services.nginx = {
-  virtualHosts."${srv}.${domain}" = {
-    serverAliases = [ domain ];
-    forceSSL = true;
-    useACMEHost = domain;
-    root = "${root}/${srv}";
-    extraConfig = ''
-      access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
-      error_log  /var/log/nginx/${domain}/${srv}/error.log warn;
-    '';
-    locations."/".extraConfig = ''
-      #autoindex on;
-      fancyindex on;
-      fancyindex_name_length 255;
-      fancyindex_exact_size off;
-    '';
-    locations."/git".return = "302 https://git.${domain}/$request_uri";
-    locations."/versions".return = "302 https://git.${domain}/$request_uri";
-    locations."/codes_sources".return = "302 https://git.code.${domain}";
-    locations."/mails".return = "302 https://mails.${domain}/$request_uri";
-    locations."/listes".return = "302 https://mails.${domain}/$request_uri";
+  systemd.services.nginx.serviceConfig = {
+    BindPaths = [
+      "/home/julm/work/sourcephile/txt:${root}/${srv}"
+    ];
+    StateDirectory = [
+      "nginx/${domain}/${srv}"
+    ];
+    LogsDirectory = lib.mkForce [
+      "nginx/${domain}/${srv}"
+    ];
+  };
+  services.nginx = {
+    virtualHosts.${domain} = {
+      serverAliases = [ "${srv}.${domain}" ];
+      forceSSL = true;
+      useACMEHost = domain;
+      root = "${root}/${srv}";
+      extraConfig = ''
+        access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
+        error_log  /var/log/nginx/${domain}/${srv}/error.log warn;
+      '';
+      locations."/".extraConfig = ''
+        #autoindex on;
+        fancyindex on;
+        fancyindex_name_length 255;
+        fancyindex_exact_size off;
+      '';
+      locations."/temp".extraConfig = ''
+        autoindex off;
+        fancyindex off;
+      '';
+      locations."/git".return = "302 https://git.${domain}/$request_uri";
+      locations."/versions".return = "302 https://git.${domain}/$request_uri";
+      locations."/codes_sources".return = "302 https://git.code.${domain}";
+      locations."/mails".return = "302 https://mails.${domain}/$request_uri";
+      locations."/listes".return = "302 https://mails.${domain}/$request_uri";
+    };
   };
-};
 }