!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1869 Members
Nix programming language343 Servers

Load older messages


SenderMessageTime
14 Mar 2026
@kenny-238:matrix.org@kenny-238:matrix.org left the room.10:37:11
@kaledriina:matrix.orgMilja K joined the room.11:08:09
@amadaluzia:tchncs.deamadaluzia[tde] joined the room.14:31:24
@luna_aura:matrix.orgLuna Aura joined the room.16:37:07
@amadaluzia:unredacted.orgamadaluzia -> 4d2.org changed their display name from amadaluzia to amadaluzia[uorg].18:49:53
@riaru:signal.v0id.nlOri changed their display name from Ori (They/Them) to Ori.19:19:54
@amadaluzia:4d2.orgamadaluzia joined the room.19:28:14
@amadaluzia:unredacted.orgamadaluzia -> 4d2.org changed their display name from amadaluzia[uorg] to amadaluzia -> 4d2.org.21:21:31
@lektricitee:matrix.orglektrik joined the room.21:22:01
15 Mar 2026
@pengipengi:matrix.orgpengi joined the room.07:24:32
@pengipengi:matrix.orgpengi

I'm looking for some debugging possibilities... When I run nix-build, it generates the top level derivation.. When looking through what its dependencies, I find some derivations I want to investigate.

(In this particular case, it's a package that ended up in a nixos vm disk image that I want to track down)

Is it possible to trace back where in my *.nix files the derivation comes from, and the call stack to get there?

I have no trouble finding the inputs for the derivation itself, but not what the inputs comes from.

07:50:42
@pengipengi:matrix.orgpengi *

I'm looking for some debugging possibilities... When I run nix-build, it generates the top level derivation.. When looking through what its dependencies, I find some derivations I want to investigate.

(In this particular case, it's a package that ended up in a nixos vm disk image that I want to track down, but that's just an example)

Is it possible to trace back where in my *.nix files the derivation comes from, and the call stack to get there?

I have no trouble finding the inputs for the derivation itself, but not what the inputs comes from.

07:50:52
@pengipengi:matrix.orgpengi set a profile picture.07:52:15
@opandddd:matrix.orgSapii You can some something like nix-store -q --tree /nix/store/hash-whatever.drv to get a tree of dependencies, almost like a call stack. 16:44:11
@alyamanmas:matrix.orgAlyaman Maasarani joined the room.17:34:27
@pengipengi:matrix.orgpengi

Thanks for the reply,

That is for sure also helpful, but not really what I'm searching for. That focuses on what derivations depends on what other derivations. Not really what expressions that leads up to a derivation.

Imagine I have a derivation, created by a function:

integrate_modules.nix:

{ modules, ... }:
let
  internalMods = ...;
  mods = modules ++ [internalMods];
in
derivation {
  ...
  myModules = mods;
}

Then I use it from something modular, that packs modules from different sources:

let
   app_a = import my_app_a.nix {...};
   app_b = import my_app_b.nix {...};
   app_c = import my_app_c.nix {...};
   integration = import ./integrate_modules.nix {
      modules = app_a.modules ++ app_b.modules ++ app_c.modules;
   }
in
  integration.build

Or something similar.

In this the case above, it's the nixos configuration, which has packages, which depends on packages depending on configuration.

In some other case, I may have built the rules myself, but it can quickly start getting messy to see where every parameter comes from.

So in the second example, the derivation will show what parameters the varaible myModules contains, evaluated. But not if it comes from internalMods or app a, b or c.

So I'm looking for some way to debug the nix expressions internally.

The closest I've seen is builtins.trace, but it's quite hard when some of the nix rules comes from external sources (in this case nixpkgs), and therefore quite hard to modify to add them to start with.

So thinking if there is some kind of debugger, where it's possible to set breakpoints and print the stack for example, or something else similar

18:07:06
@pengipengi:matrix.orgpengi* Thanks for the reply, Not really what I'm searching for though, it seems. Looks great for tracking the dependencies between derivations. I'm looking for the understanding what nix functions are called that leads up to a given derivation. Many derivations are written as generic templates, with configurations. I want to be able to see what configuration flags are set for some derivations, so I know what to change. Something similar to a debugger18:11:32
@pengipengi:matrix.orgpengi

The question is more about the tooling, since I've ended up with the same issue earlier. But in the particular case above is that I'm trying to build nixos for a minimal embedded setup. And I've found that krb5 is installed, which I find odd. I can track down the dependencies, and see what derivation depends on it. But what I then want to see is, where do that derivation come from, and what are the configuration flags, and thus the call stack of the nix functions (not derivations) that leads up to the derivation.

Closest I've found is to add builtin.trace, but that implies I can change the derivation, which is pretty hard, since lot of the code comes from imported libraries (nixpkgs for example).

18:22:27
@pengipengi:matrix.orgpengi I think what I'm looking for is nix repl --debugger, but being able to add breakpoints manually from command line. Is that possible? 18:28:57
@opandddd:matrix.orgSapiiUnfortunately, I don't think a thorough debugging implementation exists for nix yet, I do know that lix provides better error logs but that's not what you are looking for. It may be possible use the repl, import your nix files and and then inspect it like that but its harder to use.19:31:54
@wtvb:matrix.orgulucs joined the room.19:32:12
@piegames:flausch.socialpiegames
In reply to @pengipengi:matrix.org
I think what I'm looking for is nix repl --debugger, but being able to add breakpoints manually from command line. Is that possible?
No it is currently not, which is why the current REPL debugger is frankly useless. But it's on my radar, so please be (very) patient :)
20:21:35
@nightcat:continuwuity.rocksnightcat🏳️‍⚧️ joined the room.20:33:49
@isabel:isabelroses.comisabel changed their profile picture.20:56:28
16 Mar 2026
@pengipengi:matrix.orgpengi

Aha, I see 🙂 thanks, then I stop searching, and tries to solve the issue with the tools at hand.

No worries 🙂

04:19:05
@purepani:matrix.orgpurepani changed their display name from purepani to purepanid.05:54:44
@purepani:matrix.orgpurepani changed their display name from purepanid to purepani.05:55:34
17 Mar 2026
@yaoshiu:matrix.orgFay Ash joined the room.06:31:37
@iamevn:matrix.org@iamevn:matrix.org left the room.06:32:33
@squishy:squishy.pwSquishy joined the room.08:10:33

Show newer messages


Back to Room ListRoom Version: 6