oddlama / nix-topology

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

flake-parts does not work out of the box #36

Closed mrVanDalo closed 4 weeks ago

mrVanDalo commented 1 month ago

flake-parts does not work out of the box.

I need a bit to make it work with flake-parts.

I just had to set inputs and import the nixosModules in my nixosConfiguations, and with this flake part file I finally worked.

I couldn't make the thing work with easyOverlays I had to define topology.pkgs (maybe we do this inside the topology flake-module itself, ... just thinking)

{ inputs, self, ... }:
{
  imports = [
    inputs.nix-topology.flakeModule
  ];

  perSystem =
    { system, ... }:
    {
      topology.pkgs = import inputs.nixpkgs {
        inherit system;
        overlays = [ inputs.nix-topology.overlays.default ];
      };
      topology.modules = [
        {
          # Inline module to inform topology of your existing NixOS hosts.
        }
      ];
    };
}

I'm afk for a while but I could create a pull request the next days based on you feedback

(nice project btw!)

oddlama commented 4 weeks ago

Sorry for the late response, I see you already handled it :) Thanks