Skip to content

Create nix flake for compiling and developing#11231

Open
Denis101 wants to merge 7 commits intosimulationcraft:midnightfrom
Denis101:midnight
Open

Create nix flake for compiling and developing#11231
Denis101 wants to merge 7 commits intosimulationcraft:midnightfrom
Denis101:midnight

Conversation

@Denis101
Copy link
Contributor

Adds a relatively simple flake.nix that enables the following with nix (and NixOS):

  • Run nix-shell in the root directory to get a development shell pre-installed with clang and llvm.
  • Run nix build to compile simc into a nix derivation.
  • Run nix run . [options] in the root directory to run the compiled binary in the derivation.
  • Run nix fmt to format github actions, docker, and nix files. I thought about including C/C++ formatters here but figured best left out for now.
  • Includes git-hooks, which will generate a .pre-commit-config.yaml so formatting can be checked when trying to commit to git.

This can be used in flake-based NixOS configurations to include the simc package 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants