Create nix flake for compiling and developing#11231
Open
Denis101 wants to merge 7 commits intosimulationcraft:midnightfrom
Open
Create nix flake for compiling and developing#11231Denis101 wants to merge 7 commits intosimulationcraft:midnightfrom
Denis101 wants to merge 7 commits intosimulationcraft:midnightfrom
Conversation
JoeGrn
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a relatively simple
flake.nixthat enables the following with nix (and NixOS):nix-shellin the root directory to get a development shell pre-installed with clang and llvm.nix buildto compilesimcinto a nix derivation.nix run . [options]in the root directory to run the compiled binary in the derivation.nix fmtto format github actions, docker, and nix files. I thought about including C/C++ formatters here but figured best left out for now.git-hooks, which will generate a.pre-commit-config.yamlso formatting can be checked when trying to commit to git.This can be used in flake-based NixOS configurations to include the
simcpackage in theoretically any nix installation. I have only tested this on my own x86_64 NixOS (Linux 6.18) machine, so not sure if the compilation may fail in either Windows (via WSL) or macOS.