Create flake.nix for Nix users
This PR creates a flake.nix file for Nix users on Linux and MacOS.
What does this allow?
-
This allows Nix users on *Nix to create ephemeral shells with Diligent headers and shared libraries already in the required paths. A single
nix develop "git+https://github.com/DiligentGraphics/DiligentEngine.git?submodules=1"command from the terminal puts the caller in a shell with DiligentEngine installed. There is a shorter command:nix develop github:DiligentGraphics/DiligentEnginebut it doesn't work with submodules and Diligent makes heavy use of git submodules. -
Other projects using Nix flakes for their dependency management can easily integrate Diligent into their dependencies.
-
This also allows easy dependency management for Diligent. The flake file will always build diligent with the suggested
clangcompiler as described in the README, fetching all the required libraries.
I want to note that I only tested this on a NixOS machine, and it's very likely for this flake to fail to build on MacOS. Feedback would be appreciated.
If #352 gets solved, integrating Diligent into a project will be as easy as installing it and finding it using CMake's find_package.