typelevel-nix icon indicating copy to clipboard operation
typelevel-nix copied to clipboard

NIX_CC and scalapb, this is probably more of a nix flake question

Open dispalt opened this issue 3 years ago • 2 comments

Hi there, I'm trying to use this in a nixos/nix container and it's mostly working great except one thing. scalapb.

Scalapb has some checks to use $NIX_CC/nix-support/dynamic-linker if it's available and it's not available in nix develop Any ideas how to work around this?

dispalt avatar Jan 28 '22 18:01 dispalt

You can add arbitrary packages with the packages attribute:

        devShell = pkgs.devshell.mkShell {
          imports = [ typelevel-nix.typelevelShell ];
          name = "my-project-shell";
          typelevelShell = {
            jdk.package = pkgs.jdk8;
          };
          packages = [ pkgs.hello ];
        };

But I'm not sure which package would set the NIX_CC environment. (I'm not on my Linux machine at the moment, and I see in the scalapb code, the feature only works there. Maybe pkgs.glibc?)

I wouldn't mind adding a configuration option for scalapb, if we can identify an easy way to make it work.

rossabaker avatar Jan 28 '22 19:01 rossabaker

I'm running into something similar. Adding glibc didn't set the NIX_CC env variable in nix develop. It does for nix shell.

As a nix noob, I don't know how to get it set it nix develop. Any hints on how to do this?

coltfred avatar Dec 06 '22 00:12 coltfred