Modified caddy to make a simple working code
This commit is contained in:
parent
7a0797bcd8
commit
fcc9fe0773
31
hosts/v-th-ctr-01/configuration.nix
Normal file
31
hosts/v-th-ctr-01/configuration.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
@ -37,7 +37,7 @@
|
||||
|
||||
containers = {
|
||||
nginx.enable = true;
|
||||
caddy.enbale = true;
|
||||
caddy.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -23,14 +23,14 @@ in {
|
||||
"1443:8443"
|
||||
];
|
||||
volumes = [
|
||||
"~/containers/caddy/Caddyfile:/etc/caddy/Caddyfile"
|
||||
"/home/deploy/containers/caddy/Caddyfile:/etc/caddy/Caddyfile:Z"
|
||||
];
|
||||
};
|
||||
|
||||
home.file."containers/caddy/Caddyfile".text = ''
|
||||
localhost
|
||||
|
||||
response "Hello, world!"
|
||||
http://localhost {
|
||||
respond "Hello there"
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user