From cdcc6f364d97e31fa20c5e5bb90e4bcbd53ab870 Mon Sep 17 00:00:00 2001 From: kalipso Date: Fri, 28 Aug 2026 14:07:26 +0200 Subject: [PATCH] [antamap] init --- machines/antamap/configuration.nix | 52 ++++++++++++++++++++++++++++++ machines/fanny/configuration.nix | 10 ++++++ machines/hosts.nix | 5 +++ 3 files changed, 67 insertions(+) create mode 100644 machines/antamap/configuration.nix diff --git a/machines/antamap/configuration.nix b/machines/antamap/configuration.nix new file mode 100644 index 0000000..8abe5e2 --- /dev/null +++ b/machines/antamap/configuration.nix @@ -0,0 +1,52 @@ +{ self, config, lib, pkgs, inputs, ... }: + +with lib; + +let + antamap-pkg = pkgs.stdenv.mkDerivation { + name = "antamap"; + src = pkgs.fetchgit { + url = "https://0xacab.org/AND/antamap.git"; + branchName = "master"; + rev = "f62cc588df661e089d4ffb17adb78e667bda8f87"; + sha256 = "sha256-vMAk2pphApkp1YkFBtX4cQDAyxDgMLnrhI4DTVgBYdE="; + }; + + installPhase = "mkdir -p $out; cp -R * $out/"; + }; +in +{ + networking = { + hostName = mkDefault "antamap"; + useDHCP = false; + }; + + imports = [ + ../modules/malobeo_user.nix + ../modules/sshd.nix + ]; + + services.nginx = { + enable = true; + virtualHosts."_" = { + listen = [ + { addr = "0.0.0.0"; port = 80; } + ]; + root = "${antamap-pkg}"; + extraConfig = '' + proxy_buffering off; + proxy_cache off; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + ''; + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 ]; + + system.stateVersion = "22.11"; # Did you read the comment? +} + diff --git a/machines/fanny/configuration.nix b/machines/fanny/configuration.nix index c398678..6e5a4b9 100644 --- a/machines/fanny/configuration.nix +++ b/machines/fanny/configuration.nix @@ -146,6 +146,7 @@ in "zineshop" "vaultwarden" "pretalx" + "antamap" ]; networking = { @@ -286,6 +287,15 @@ in ''; }; }; + + virtualHosts."antamap.malobeo.org" = { + locations."/" = { + proxyPass = "http://${hosts.malobeo.hosts.antamap.network.address}:80"; + extraConfig = '' + proxy_set_header Host $host; + ''; + }; + }; }; services.tor = { diff --git a/machines/hosts.nix b/machines/hosts.nix index e194ed1..0b62e20 100644 --- a/machines/hosts.nix +++ b/machines/hosts.nix @@ -108,6 +108,11 @@ in type = "microvm"; network = createMaloNet "18" "52:DA:0D:F9:EF:F4"; }; + + antamap = { + type = "microvm"; + network = createMaloNet "20" "52:DA:0D:F9:EF:F6"; + }; }; }; }