{ pkgs, config, ... }: { dns.zones."ctu.cx".subdomains."ip" = (pkgs.dns.lib.combinators.host config.networking.primaryIP4 config.networking.primaryIP); dns.zones."ctu.cx".subdomains."ip4".A = [ (pkgs.dns.lib.combinators.a config.networking.primaryIP4) ]; dns.zones."ctu.cx".subdomains."ip6".AAAA = [ (pkgs.dns.lib.combinators.aaaa config.networking.primaryIP) ]; services.nginx.virtualHosts."ip.${config.networking.domain}" = { enableACME = true; forceSSL = true; kTLS = true; locations."/" = { extraConfig = "types { } default_type 'text/html; charset=utf-8';"; return = ''200 ' ip.${config.networking.domain}

ip.${config.networking.domain}

Use bash and curl: curl ip{4,6}.${config.networking.domain}

Because any other "Whats my IP?"-tool sucks. Host yourself :3

' ''; }; }; services.nginx.virtualHosts."ip4.${config.networking.domain}" = { enableACME = true; forceSSL = true; kTLS = true; locations."/" = { return = "200 '$remote_addr\n'"; extraConfig = '' types { } default_type "text/plain; charset=utf-8"; add_header Access-Control-Allow-Origin *; ''; }; }; services.nginx.virtualHosts."ip6.${config.networking.domain}" = { enableACME = true; forceSSL = true; kTLS = true; locations."/" = { return = "200 '$remote_addr\n'"; extraConfig = '' types { } default_type "text/plain; charset=utf-8"; add_header Access-Control-Allow-Origin *; ''; }; }; }