#devShells

World's Okayest Gopherarichtman@eigenmagic.net
2025-05-30

Find why your devShell, package, etc depends on something interactively!

`nix-tree --derivation .#devShells.x86_64-linux.default`

github.com/utdemir/nix-tree

#Nix #NixFlakes #NixOS

World's Okayest Gopherarichtman@eigenmagic.net
2025-05-30

@uep `nix-tree --derivation .#devShells.x86_64-linux.default` landed it. Jujutsu wants gnupg which wants openldap - because reasons I guess

World's Okayest Gopherarichtman@eigenmagic.net
2025-05-30

@uep `nix why-depends .#devShells.x86_64-linux.default github:nixos/nixpkgs/nixpkgs-unstable#openldap` complains about the second argument not evaluating to one store path. I'm hoping it'll work off the `nixpkgs-unstable` branch, otherwise I can pull the `flake.lock` nixpkgs commit sha to make it line up exactly.

World's Okayest Gopherarichtman@eigenmagic.net
2025-05-30

`nix derivation show .#devShells.x86_64-linux.default` yields some store paths from first-tier dependencies, maybe I use why-depends with those until I hit it?

World's Okayest Gopherarichtman@eigenmagic.net
2025-05-30

Is there a way to see why a Flake DevShell depends on a given package easily?

`nix path-info -r .#devShells.x86_64-linux.default` seems obvious but no worky

#Nix #NixFlakes

Sam Lehman :nixos:Lehmanator@fosstodon.org
2025-04-08

A big shortcoming of #Nix #devshells is that it's difficult to wrap #editor & #LSP configs for your project.

This is the number one thing I would want a #devshell for after installing dependencies, rendering them always inadequate/incomplete.

2024-01-27

@terrorjack (the creativity necessary to use a nix file is essentially `nix eval --json .#devShells.x86_64-linux.devShells.default --apply 'builtins.unsafeGetAttrPos "buildInputs"'`, shoving that position into your choice of nix parser such as rnix, then finding any list that's unconditionally added there and adding it)

(it's not *hard*, i just don't think anyone with the necessary knowledge has actually done it because they simply have other stuff to do)

2024-01-26

@tristanC I'm not sure there's a tool for doing exactly what you're asking for yet (but it would be really nice to have and shouldn't be too hard to implement!), but nix-diff could be interesting for observing the changes in what you end up building. Apply nix-diff to the shell drv files before and after (nix eval .#devShells.x86_64-linux.default.drvPath) and it'll show you exactly what changed on the derivation level — so what's actually built.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst