initial(ish) commit
This commit is contained in:
commit
b744693f0e
88 changed files with 4925 additions and 0 deletions
38
nixos-modules/services/nginx.nix
Normal file
38
nixos-modules/services/nginx.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ragon.services.nginx;
|
||||
in
|
||||
{
|
||||
options.ragon.services.nginx.enable = lib.mkEnableOption "Enables nginx";
|
||||
options.ragon.services.nginx.domain =
|
||||
lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "hailsatan.eu";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
};
|
||||
security.acme.defaults.email = "nixosacme@phochkamp.de";
|
||||
security.acme.acceptTerms = true;
|
||||
security.acme.certs."${cfg.domain}" = {
|
||||
dnsProvider = "cloudflare";
|
||||
dnsResolver = "1.1.1.1:53";
|
||||
group = "nginx";
|
||||
extraDomainNames = [
|
||||
"*.${cfg.domain}"
|
||||
];
|
||||
credentialsFile = "${config.age.secrets.cloudflareAcme.path}";
|
||||
|
||||
};
|
||||
ragon.agenix.secrets.cloudflareAcme = { group = "nginx"; mode = "0440"; };
|
||||
ragon.persist.extraDirectories = [
|
||||
"/var/lib/acme"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue