initial config commit
This commit is contained in:
parent
f8980b6805
commit
f3dc1d15ff
79 changed files with 2725 additions and 0 deletions
47
modules/nixos/features/nginx.nix
Normal file
47
modules/nixos/features/nginx.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = "nginx";
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.${feature}.enable {
|
||||
age.secrets."api-porkbun" = {
|
||||
file = ../../../secrets/api-porkbun.age;
|
||||
};
|
||||
|
||||
services.${feature} = {
|
||||
enable = true;
|
||||
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
|
||||
virtualHosts."*.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/".index = "index.html";
|
||||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "wi11@duck.com";
|
||||
certs."fi33.buzz" = {
|
||||
domain = "fi33.buzz";
|
||||
extraDomainNames = [ "*.fi33.buzz" ];
|
||||
group = "${feature}";
|
||||
dnsProvider = "porkbun";
|
||||
dnsPropagationCheck = true;
|
||||
credentialsFile = config.age.secrets."api-porkbun".path;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${feature}.extraGroups = [ "acme" ];
|
||||
};
|
||||
|
||||
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue