nixos doesn’t install headers and cmake files by default
if you want to compile with libraries etc
you can use nix-shell -p {your libraries} for quickly experimenting
or creating nix development environment using pkgs.mkShell and adding
libraries to buildInputs
and you probably dont need to add opengl drivers to LD_LIBRARY_PATH
Thank you.
Yeah, reading about that, in reddit recommend me to use Development environment.
As a new NixOS user, still don’t understand about flask, home manager and Dev Env. And I just add everything to the configuration.nix file.
{ pkgs ? import <nixpkgs> { } }:
pkgs.llvmPackages.stdenv.mkDerivation {
name = "some-name";
nativeBuildInputs = with pkgs;[ cmake pkg-config ];
buildInputs = with pkgs;[
glfw
glm
lua
];
}
here is a simple definition for shell.nix you will need to add runtime packages(and libraries) to buildInputs and build tools(like shader compilers build systems) to nativeBuildInputs and if you want to change compiler you can use diffrent stdenv like pkgs.stdenv or pkgs.llvmPackages.stdenv(this is for clang).
After writing this to shell.nix in root dir of your project run nix-shell and your development shell is ready
Note: when creating a package you should use pname and version instead of directly setting name attribute but this shouldnt matter for creating devenv
mkShell is just some modified version of mkDerivation, i used mkDerivation because i can select compiler