Create flake.nix for Nix users #356
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR creates a
flake.nixfile 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.