🔧 plato: clean up traefik config
This commit is contained in:
53
modules/traefik/default.nix
Normal file
53
modules/traefik/default.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.traefik = {
|
||||
enable = true;
|
||||
group = "docker";
|
||||
staticConfigOptions = {
|
||||
api = {
|
||||
dashboard = true;
|
||||
insecure = true;
|
||||
};
|
||||
certificatesResolvers = {
|
||||
myresolver = {
|
||||
acme = {
|
||||
email = "walkah@walkah.net";
|
||||
storage = "/var/lib/traefik/acme.json";
|
||||
dnsChallenge = {
|
||||
provider = "cloudflare";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
entryPoints = {
|
||||
web = {
|
||||
address = ":80";
|
||||
http = {
|
||||
redirections = {
|
||||
entryPoint = {
|
||||
to = "websecure";
|
||||
scheme = "https";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
websecure = {
|
||||
address = ":443";
|
||||
};
|
||||
};
|
||||
providers = {
|
||||
docker = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.services.traefik = {
|
||||
serviceConfig = {
|
||||
EnvironmentFile = config.sops.secrets.traefik.path;
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets.traefik = {
|
||||
owner = "traefik";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user