l002 nixos mode

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-01-10 11:22:13 -06:00
parent e067fb9f54
commit 2e6720e6e7
12 changed files with 362 additions and 52 deletions

View file

@ -1,7 +1,71 @@
{
config,
...
}:
{
boot.loader.grub.enable = true;
system.stateVersion = "24.11";
containers.wasabi = {
ephemeral = true;
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.2";
localAddress = "192.168.100.11";
config =
{ config, pkgs, ... }:
{
system.stateVersion = "24.11";
services.httpd.enable = true;
services.httpd.adminAddr = "foo@example.org";
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 ];
};
};
};
virtualisation.oci-containers = {
backend = "docker"; # or "podman"
containers = {
# Example of defining a container from the compose file
"test_nginx" = {
# autoStart = true; this is default true
image = "nginx:latest";
ports = [
"127.0.0.1:8085:80"
];
};
};
};
security.acme.acceptTerms = true;
security.acme.email = "admin@joshuabell.xyz";
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"_" = {
default = true;
locations."/wasabi/" = {
extraConfig = ''
rewrite ^/wasabi/(.*) /$1 break;
'';
proxyPass = "http://${config.containers.wasabi.localAddress}:80/";
};
locations."/" = {
# return = "404"; # or 444 for drop
proxyPass = "http://127.0.0.1:8085/";
};
};
};
};
networking.firewall.allowedTCPPorts = [
80
443
];
}