caddy and hello world container

This commit is contained in:
reudy14 2026-04-20 01:28:28 +02:00 • committed by Jakub Dorfman
parent 4577585e2c
commit f52e433423
3 changed files with 41 additions and 0 deletions

27
containers/hello.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
containers.hello = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
config = { config, pkgs, ... }: {
system.stateVersion = "25.11";
networking.firewall.allowedTCPPorts = [ 80 ];
services.nginx = {
enable = true;
virtualHosts."localhost" = {
# Return a 200 OK directly from nginx
locations."/".return = "200 'Hello world!'";
locations."/".extraConfig = ''
default_type text/plain;
'';
};
};
};
};
}