Hi, I am trying to get a development shell with some packages from the nixpkgs and one I have pulled from github. after disabling the sandbox, I was able to get a development shell with the github package build. Assuming (maybe wrongly) that the headers provided by this package will be available in the nix develop shell path I try to compile a simple cpp program. But gcc says the header is not found. I am not sure which other path to set for nix develop shell to pickup these headers which do exist in the nix store. The paths are included as the buildInputs of the mkShell function, but still no joy.
cpp program below
#include <uhal/uhal.hpp>
int main() {return 0;}
flake.nix used below
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
uhal = pkgs.stdenv.mkDerivation {
name = "build-uhal";
src = builtins.fetchGit { url = "https://github.com/joealsubash/ipbus-software.git";
ref = "jsubash/nix";
rev = "cd1947655f24c7bd73727471e854bbbdd4240bf4"; };
dontConfigure = true;
installPhase = "mkdir -p $out/opt/cactus/; mkdir -p $out/local/include; make install prefix=$out/opt/cactus includedir=$out/local/include";
nativeBuildInputs = with pkgs; [
cacert boost pugixml python311Packages.pybind11 erlang rebar git
];
buildInputs = with pkgs; [
cacert boost pugixml python311Packages.pybind11 erlang rebar git
];
};
in
{
devShells.x86_64-linux.default = pkgs.mkShell {
packages = [
pkgs.python311
pkgs.boost
pkgs.git
pkgs.cmake
"${uhal}/local/include/"
];
};
buildInputs = ["${uhal}/local/include/"];
nativeBuildInputs = ["${uhal}/local/include/"];
};
}
Thanks.