add(server)
This commit is contained in:
51
config/modules/services/traefik.nix
Normal file
51
config/modules/services/traefik.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
den,
|
||||
__findFile,
|
||||
modules,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Basic traefik
|
||||
modules.services.traefik = {
|
||||
services.traefik = {
|
||||
nixos =
|
||||
{ config, ... }:
|
||||
{
|
||||
enable = true;
|
||||
|
||||
staticConfigOptions = {
|
||||
entryPoints = {
|
||||
web = {
|
||||
address = ":80";
|
||||
http.redirections.entrypoint = {
|
||||
to = "websecure";
|
||||
scheme = "https";
|
||||
};
|
||||
asDefault = true;
|
||||
};
|
||||
websecure = {
|
||||
address = ":443";
|
||||
asDefault = true;
|
||||
http.tls.certResolver = "letsencrypt";
|
||||
};
|
||||
traefik = {
|
||||
address = ":8080";
|
||||
};
|
||||
};
|
||||
certificatesResolvers.letsencrypt.acme = {
|
||||
email = "doloroo@proton.me";
|
||||
storage = "${config.services.traefik.dataDir}/acme.json";
|
||||
httpChallenge.entryPoint = "web";
|
||||
};
|
||||
providers = {
|
||||
docker = {
|
||||
endpoint = "unix:///var/run/docker.sock";
|
||||
};
|
||||
};
|
||||
api.dashboard = true;
|
||||
api.insecure = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user