From c0d5a9a9b5990cd7c8bf9a0a5bdda6eefc96c43d Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Wed, 31 Oct 2018 15:10:56 +0100 Subject: [PATCH] feat: configure traefik for https --- home.nix | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/home.nix b/home.nix index e404f29..9cee7a5 100644 --- a/home.nix +++ b/home.nix @@ -4,6 +4,28 @@ let latest = import {}; in { + home.file.".config/traefik/traefik.toml".text = '' +logLevel = "INFO" +defaultEntryPoints = ["http", "https"] + +[web] +address = ":8080" + +[entryPoints] + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + entryPoint = "https" + [entryPoints.https] + address = ":443" + [entryPoints.https.tls] + +[docker] +domain = "test" +watch = true +network = "traefik" + ''; + home.packages = with pkgs; [ latest.wget latest.curl @@ -172,7 +194,7 @@ in { command = "parcellite -d"; notification = false; } { command = "numlockx on"; notification = false; } # turn verr num on - # docker run -d --net traefik --ip 172.10.0.10 --restart always -v /dev/null:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock:ro --name traefik --label traefik.port=8080 traefik --web --docker --docker.domain=test --logLevel=INFO + # docker run -d --net traefik --ip 172.10.0.10 --restart always -v $HOME/.config/traefik/traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock:ro --name traefik --label traefik.port=8080 traefik { command = "docker start traefik"; notification = false; } ]; };