diff --git a/hosts/hackens-org/modules/nginx.nix b/hosts/hackens-org/modules/nginx.nix new file mode 100644 index 0000000..5bf0bcc --- /dev/null +++ b/hosts/hackens-org/modules/nginx.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + services.nginx = { + recommendedTlsSettings = true; + recommendedProxySettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + }; +} diff --git a/hosts/hackens-org/modules/static-website.nix b/hosts/hackens-org/modules/static-website.nix new file mode 100644 index 0000000..7a4a641 --- /dev/null +++ b/hosts/hackens-org/modules/static-website.nix @@ -0,0 +1,26 @@ +{ lib, config }: + +with lib; +let + cfg = config.services.static-website.config; + l = builtins.split cfg.name "/"; + name = lists.last l; +in +{ + services.static-website.config = lib.mkOption { + type = with types; attrsOf (submodule { + options.name = mkOption path; + }); + }; + + config = { + services.nginx.enable = cfg.enable; + virtualHosts."${cfg.name}" = { + root = "/var/lib/nginx/static/${name}"; + } + }; +} + +/* TODO +ACME +*/