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

fix(renderers/svg): respect service details' order #34

Closed jlbribeiro closed 2 months ago

jlbribeiro commented 2 months ago

First of all, thank you so much for open-sourcing this wonderful project! I find it a quite elegant solution, not only in terms of ergonomics, but also because of its aesthetics!

What and How

Addresses renderers/svg FIXME comment by implementing the service details' order; makes use of the order field, as documented and specified in options/services.nix.

Defaults to names lexicographical order in case of an order tie (e.g. when order is not specified), which feels like the (current and) expected behavior.

Snippet

{
  # ...
  details.http = {
    text = toString config.services.tvheadend.httpPort;
    order = 1;
  };
  details.htsp = {
    text = toString config.services.tvheadend.htspPort;
    order = 2;
  };
}

Before

before

After

after

Checklist

Please let me know if something's off or missing, and once again thank you for your work.

oddlama commented 2 months ago

Thanks for the kind words, glad to hear!

I totally forgot about that one, thanks for implementing it. Your code looks great so far, I don't think I have anything else to add.