-
-
Notifications
You must be signed in to change notification settings - Fork 8
debugging
Victor Borja edited this page Feb 8, 2026
·
1 revision
Use trace to print values while debugging or break to enter a repl
at some particular evaluation part.
den.aspects.foo = { user, ... }@context:
(builtins.trace context {
nixos = { ... };
})Use the nix repl command to load your flake and be able to interatively
inspect produced outputs.
nix repl
> :lf . # load flake
> nixosConfigurations.igloo.config # inspect valuestemporarely expose den as flake output so you can inspect den.aspects.<foo>
{ den, ... }:
{
flake.den = den; # remove this once you are done debugging.
}den.default.includes = [
(context: builtins.trace context { })
];at repl:
# if foo is parametric, use `(den.aspects.foo { params... }).resolve ...`
> module = den.aspects.foo.resolve { class = "homeManager"; aspect-chain = [ ]; }
> config = (lib.evalModules { modules = [ module ]; }).configat repl:
> module = den.hosts.x86_64-linux.igloo.mainModule
> config = (lib.evalModules { modules = [ module ]; }).config