format all code with alejandra
This commit is contained in:
parent
fa0cda2673
commit
4f0d45e4d5
89 changed files with 1605 additions and 1298 deletions
|
|
@ -1,16 +1,20 @@
|
|||
# Part of config shamelessly stolen from:
|
||||
#
|
||||
# https://github.com/delroth/infra.delroth.net
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
;
|
||||
in
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
mkIf
|
||||
;
|
||||
in {
|
||||
# Whenever something defines an nginx vhost, ensure that nginx defaults are
|
||||
# properly set.
|
||||
config = mkIf ((builtins.attrNames config.services.nginx.virtualHosts) != [ "localhost" ]) {
|
||||
config = mkIf ((builtins.attrNames config.services.nginx.virtualHosts) != ["localhost"]) {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
statusPage = true; # For monitoring scraping.
|
||||
|
|
@ -21,7 +25,7 @@ in
|
|||
recommendedProxySettings = true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
|
||||
services.prometheus = {
|
||||
exporters.nginx = {
|
||||
|
|
@ -32,12 +36,14 @@ in
|
|||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "nginx";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}" ];
|
||||
labels = {
|
||||
instance = config.networking.hostName;
|
||||
};
|
||||
}];
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"];
|
||||
labels = {
|
||||
instance = config.networking.hostName;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
@ -46,18 +52,17 @@ in
|
|||
acceptTerms = true;
|
||||
defaults.email = "antoine97.martin@gmail.com";
|
||||
|
||||
certs =
|
||||
let
|
||||
domain = config.networking.domain;
|
||||
gandiKey = config.my.secrets.gandiKey;
|
||||
in {
|
||||
"${domain}" = {
|
||||
extraDomainNames = [ "*.${domain}" ];
|
||||
dnsProvider = "gandiv5";
|
||||
credentialsFile = config.age.secrets."gandi/api-key".path;
|
||||
group = "nginx";
|
||||
};
|
||||
certs = let
|
||||
domain = config.networking.domain;
|
||||
gandiKey = config.my.secrets.gandiKey;
|
||||
in {
|
||||
"${domain}" = {
|
||||
extraDomainNames = ["*.${domain}"];
|
||||
dnsProvider = "gandiv5";
|
||||
credentialsFile = config.age.secrets."gandi/api-key".path;
|
||||
group = "nginx";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue