-
|
Would it be possible to add some facility to dump the generated configuration after everything is tangled up and wired together? I'm thinking about a I think this could help new users, particularly in these early stages of development to be able to directly inspect the generated outcome of their actions and be able to debug a little easier? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
|
Hey, @xdbr. I'd say that everything is possible unless proven otherwise. I also like the idea of exploring generating diagrams, since flake-aspects form both a tree and a dependency graph, it would be nice to have a way to visualize it. Having said that, I don't believe it is currently on my roadmap -I'm trying hard for Den to be stable enough to move on into social aspects in denful-, but it can be part of yours, feel free to explore the idea, I'd be glad to help if you are willing to put some code into the idea. But I'm sure this will come very valuable as more people try to understand their own configurations and available aspects. So, here are some ideas (nothing proven, just what is on top of my mind right now), feel free to explore, this could be a cool project on itself. Target configuration is available on each Host/Home via their { config, ... }:
{
perSystem = { pkgs, ... }:
{
packages.dumpConfiguration = pkgs.writeShellApplication
let
hostConfig = config.den.hosts.x86_64-linux.my-laptop.mainModule;
graph = # TODO: traverse hostConfig and generate a visualization of it.
in
{
name = "dumpConfiguration";
text = ''
somehow dump the graph here, use graphviz or anything you are exploring.
'';
};
}
}Something like that, From the name of your app, I believe this is what you are targetting, generating a visualization of the generated configuration. I'd personally be more interested in visualizing the aspect trees themselves (my interest is in having people know what tools are available to them). But again, I see value on both goals. First steps I'd recommend is, use { config, ... }:
{
flake.myHostModule = config.den.hosts.x86_64-linux.my-laptop.mainModule;
}and try exploring that The only limitation to "dumping" would be functions, they are not serializable, and anything behind a function would need first to call the function for you to visualize the result. And Den uses a LOT of functions, aspects are functions to plain configurations, so there's something to be aware of. Yours is a very good idea, thanks for sharing it. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @vic, I'm sorry if the example of nix-topology was misleading – I didn't mean a visualisation per se, but rather dumping the resulting For debugging purposes, I have already started to explore In case dumping the resulting configuration instead of a visualisation is not at too far a distance, maybe it can still be useful? Thanks for all your efforts and your quick and detailed responses! :) |
Beta Was this translation helpful? Give feedback.
-
|
As a heads-up, I just found https://github.com/bluskript/nix-inspect which can be useful to inspect the resulting configuration at |
Beta Was this translation helpful? Give feedback.

As a heads-up, I just found https://github.com/bluskript/nix-inspect which can be useful to inspect the resulting configuration at
outputs.nixosConfigurations!