oddlama / nix-topology

🍁 Generate infrastructure and network diagrams directly from your NixOS configurations
https://oddlama.github.io/nix-topology
MIT License
556 stars 24 forks source link

feat(extractors/services): Add support for Static Web Server and Traefik #22

Closed hauskens closed 6 months ago

hauskens commented 6 months ago

Added 2 services

Static Web Server is a quite simple web service, in this example i have configured the service with this block:

services.static-web-server = {
    enable = true;
    root = "/var/lib/web-server";
    listen = "[::]:5000";
  };

Traefik option will assume the user is using the services.traefik.dynamicConfigOptions to fill the details, otherwise it will be left blank. I know the dynamicConfigFile option exists, but i don't know how to handle that, so maybe that can be improved in the future to support it.

image

Originally i wanted to show the route rule that is used, but this got too cluttered.

Tested with and without a dynamicConfigOptions. In above screenshot 'exoticSite' route is configured towards a service name that does not exist.

IogaMaster commented 6 months ago

Other than that looks good to me

hauskens commented 6 months ago

Hi @IogaMaster!

Thanks for the feedback, really appreciated. I agree changing it to root makes more sense since that is what the option is also called in services.static-web-server.root.

I also rebased to remove the merge commit, it took a few attempts as i'm not too familiar with these git features, but i think i got it right.

oddlama commented 6 months ago

Thanks a lot, looks great!