!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

864 Members
167 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
19 Feb 2024
@philiptaron:matrix.org@philiptaron:matrix.org

It's coming from pkgs.mkShell.

To read how that happens, open up pkgs/top-level/all-packages.nix, find mkShell. That gets you to pkgs/build-support/mkshell/default.nix.

Inside pkgs/build-support/mkshell/default.nix, note how the return value is stdenv.mkDerivation. (that stdenv is the key).

Consider also mkShellNoCC for your use case. Note how that definition in pkgs/top-level/all-packages.nix does this:

mkShellNoCC = mkShell.override { stdenv = stdenvNoCC; };

You can do similarly to override the stdenv with whatever's appropriate for your usecase.

16:50:23
@mr-qubo:matrix.orgmr-quboThanks, that's very helpful!16:54:12
@bitraten:matrix.orgbitraten joined the room.19:27:19
@mr-qubo:matrix.orgmr-qubo
In reply to @mr-qubo:matrix.org
When I do e.g. nix shell 'nixpkgs#htop' only htop is added to path. But if I create flake with devShell and htop in buildInputs, and use nix develop dependencies are added into the PATH as well, like with nix-shell -p htop. Is it possible to have this work as nix shell?
Also, as a second question, is it possible to group multiple packages and link all bins in one path, so only one entry in PATH is added instead of separate entry for each package?
I switched to https://devenv.sh/. It fixes my problem with unwanted packages in PATH and automatically uses buildEnv to create single PATH entry for all packages.
20:05:55
20 Feb 2024
@sofo:matrix.org@sofo:matrix.org changed their display name from Sofi to Sofie.07:39:15
@sofo:matrix.org@sofo:matrix.org changed their profile picture.14:39:08

Show newer messages


Back to Room ListRoom Version: 6