Skip to content

Commit

Permalink
chore: adds examples on examples/mkcert/devenv.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
rmachado-studocu committed Nov 2, 2023
1 parent e8fd5d4 commit d5fd391
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/mkcert/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@
{
certificates = [
"example.com"
"another-example.com"
];

hosts = {
"example.com" = "127.0.0.1";
"another-example.com" = [ "127.0.0.1" "::1" ];
};

services.caddy.enable = true;
services.caddy.virtualHosts."example.com" = {
extraConfig = ''
tls ${config.env.DEVENV_STATE}/mkcert/example.com.pem ${config.env.DEVENV_STATE}/mkcert/example.com-key.pem
respond "Hello, world!"
respond "Hello, world from example.com!"
'';
};
services.caddy.virtualHosts."another-example.com" = {
extraConfig = ''
tls ${config.env.DEVENV_STATE}/mkcert/another-example.com.pem ${config.env.DEVENV_STATE}/mkcert/another-example.com-key.pem
respond "Hello, world from another-example.com!"
'';
};
}

0 comments on commit d5fd391

Please sign in to comment.