nix-topology

With nix-topology you can automatically generate infrastructure and network diagrams as SVGs directly from your NixOS configurations, and get something similar to the diagram here. It defines a new global module system where you can specify what nodes and networks you have. Most of the work is done by the included NixOS module which automatically collects all the information from your hosts.

After including this flake-parts module, you can build your diagram by running nix build .#topology.<current-system>.config.output.

Installation

To use these options, add to your flake inputs:

nix-topology.url = "github:oddlama/nix-topology";

and inside the mkFlake:

imports = [
  inputs.nix-topology.flakeModule
];

Run nix flake lock and you're set.

Options

flake.topology

The evaluated topology configuration, for each of the specified systems. Build the output by running nix build .#topology.$system.config.output.

Type: lazy attribute set of unspecified value (read only)

Default: "Automatically filled by nix-topology"

Declared by:

perSystem.topology.modules

A list of additional topology modules to evaluate in your global topology.

Type: list of unspecified value

Default: [ ]

Declared by:

perSystem.topology.nixosConfigurations

All nixosSystems that should be evaluated for topology definitions.

Type: lazy attribute set of unspecified value

Default: self.nixosConfigurations

Declared by:

perSystem.topology.pkgs

The package set to use for the topology evaluation on this system.

Type: unspecified value

Default: pkgs # (module argument)

Declared by: