# Debugging a flake

**URL:** https://discourse.nixos.org/t/debugging-a-flake/14898
**Category:** Help
**Created:** [September 7, 2021, 5:59am UTC](https://discourse.nixos.org/t/debugging-a-flake/14898 "2021-09-07T05:59:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sephi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sephi/32/7869_2.png) [@sephi](https://discourse.nixos.org/u/sephi)
#### Post date: [September 7, 2021, 5:59am UTC](https://discourse.nixos.org/t/debugging-a-flake/14898/1 "2021-09-07T05:59:44Z")

</div>

Hello,

I’ve been struggling getting my first flake to work. [The flake](https://github.com/sephii/taxi/blob/9eef70c90d47d2b8d9d5343b74b41c7f3eaac166/flake.nix) provides a package called `taxi`, which has [a `withPlugins` passthru](https://github.com/sephii/taxi/blob/9eef70c90d47d2b8d9d5343b74b41c7f3eaac166/pkgs.nix#L4) (the idea being that you install the package like so: `taxi.withPlugins (ps: [ps.clockify])`. Adding it to my NixOS configuration.nix fails with an error `attribute 'withPlugins' missing`:

```nix
(import inputs.taxi).taxi.withPlugins (ps: [ps.clockify])

```

I ended up fixing it by trial and error with `(import inputs.taxi).packages.${system}.taxi.withPlugins`, which I guess is the correct way to do it?

More importantly I was wondering if there’s a good way to debug a flake? Before using flakes I could start a repl and do `import <taxi>` and then inspect it, which was very useful. Now I know I can do `nix flake show .`, which is nice, but doesn’t allow me to inspect the derivations and try to call passthru attrs.

So is there a way to use a flake input in a repl, or is there any other way to debug a flake?

---

<div class="post-metadata">

### Author: ![ilkecan](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/i/3be4f8/32.png) [@ilkecan](https://discourse.nixos.org/u/ilkecan)
#### Post date: [September 7, 2021, 12:17pm UTC](https://discourse.nixos.org/t/debugging-a-flake/14898/2 "2021-09-07T12:17:53Z")

</div>

Are you aware of the `:lf` command inside `nix-repl`?

```auto
nix-repl> :help
...
  :lf <ref> Load Nix flake and add it to scope
...

```

So, you should be able to do `:lf .` inside the flake directory and then inspect the `outputs` variable:

```auto
nix-repl> :lf .
Added 13 variables.

nix-repl> outputs.<hit tab>
outputs.checks outputs.overlay outputs.packages
outputs.defaultPackage outputs.overlays

nix-repl> outputs.packages.<hit tab>
outputs.packages.aarch64-darwin outputs.packages.x86_64-darwin
outputs.packages.aarch64-linux outputs.packages.x86_64-linux
outputs.packages.i686-linux

```

etc.

---

<div class="post-metadata">

### Author: ![sephi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sephi/32/7869_2.png) [@sephi](https://discourse.nixos.org/u/sephi)
#### Post date: [September 7, 2021, 1:54pm UTC](https://discourse.nixos.org/t/debugging-a-flake/14898/3 "2021-09-07T13:54:58Z")

</div>

Awesome, that’s exactly what I was looking for. Thanks!
