Modified caddy to make a simple working code

This commit is contained in:
Timo Boomers 2025-04-25 21:09:55 +02:00
parent 7a0797bcd8
commit fcc9fe0773
3 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,31 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ modulesPath, ... }:
{
imports = [
# Include the default incus configuration.
"${modulesPath}/virtualisation/lxc-container.nix"
# Include the container-specific autogenerated configuration.
];
networking = {
dhcpcd.enable = false;
useDHCP = false;
useHostResolvConf = false;
};
systemd.network = {
enable = true;
networks."50-eth0" = {
matchConfig.Name = "eth0";
networkConfig = {
DHCP = "ipv4";
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
};
};
}

View File

@ -37,7 +37,7 @@
containers = { containers = {
nginx.enable = true; nginx.enable = true;
caddy.enbale = true; caddy.enable = true;
}; };
}; };

View File

@ -23,14 +23,14 @@ in {
"1443:8443" "1443:8443"
]; ];
volumes = [ volumes = [
"~/containers/caddy/Caddyfile:/etc/caddy/Caddyfile" "/home/deploy/containers/caddy/Caddyfile:/etc/caddy/Caddyfile:Z"
]; ];
}; };
home.file."containers/caddy/Caddyfile".text = '' home.file."containers/caddy/Caddyfile".text = ''
localhost http://localhost {
respond "Hello there"
response "Hello, world!" }
''; '';
}; };
} }