How to set up a nix-shell with GNU build toolchain (build-essential)?

More specify, is there a nix-shell equivalent of

apt-get install build-essential

or

dnf groupinstall "Development Tools" "Development Libraries"

Thank you

Start with an empty shell.nix:

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  buildInputs = [
  ];
}

… and you’ll basically get that. As you discover more build dependencies you can add them to that shell.nix.

2 Likes

Thanks, raboof

I’m using such a shell.nix for my need

with (import <nixpkgs> {}) ;
mkShell {
  buildInputs = [
    bison
    flex
    fontforge
    makeWrapper
    pkg-config
    gnumake
    gcc
    libiconv
    autoconf
    automake
    libtool # freetype calls glibtoolize
  ];
}

Most of those are already present by default! That’s what stdenv originally was all about.