mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-31 17:20:53 +02:00
33 lines
710 B
Nix
33 lines
710 B
Nix
{ lib, pkgs, config, ... }:
|
|
with lib;
|
|
let cfg = config.luj.nginx;
|
|
in {
|
|
|
|
options.luj.nginx = {
|
|
enable = mkEnableOption "activate nginx service";
|
|
email = mkOption {
|
|
type = types.str;
|
|
default = "julien.malka@me.com";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
security.acme.email = "${cfg.email}";
|
|
security.acme.acceptTerms = true;
|
|
users.groups.nginx = { name = "nginx"; };
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
recommendedOptimisation = true;
|
|
recommendedTlsSettings = true;
|
|
clientMaxBodySize = "128m";
|
|
|
|
commonHttpConfig = ''
|
|
server_names_hash_bucket_size 128;
|
|
'';
|
|
};
|
|
|
|
};
|
|
}
|