Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C/C++ development flake with some sane defaults. #40

Merged
merged 19 commits into from
Apr 26, 2024
Merged

Add C/C++ development flake with some sane defaults. #40

merged 19 commits into from
Apr 26, 2024

Conversation

joelbenway
Copy link
Contributor

This is my stab at a flake for a C/C++ toolchain. Here's my reasoning for adding what I did:

  • A commented out override of the stdenv with an instruction on how to change the compiler.
  • clang-tools, this package includes the excellent and ubiquitous clangd, clang-tidy, clang-format utilities
  • cmake, the most popular build system
  • codespell, not specifically a C/C++ tool but I like it
  • conan, popular C/C++ package manager
  • cppcheck, static analysis tool that pairs well with clang-tidy as they cover different ground
  • doxygen, popular tool that generates docs from annotated source code
  • gdb, debugger
  • gtest, this is google's unit test framework library, I just wanted to show you can add libraries with nix for your build system to find so I chose a popular development time one.
  • lcov, test coverage tool
  • vcpkg, the other popular package manager
  • vcpkg-tool, used with vcpkg

I think I plumbed all of this in correctly and updated the necessary docs. You might notice vcpkg packages are missing versions. The tool returns '2999-12-31-unknownhash' when prompted for a version which is obviously wrong. This one appears relatively new to Nix.

@lucperkins
Copy link
Contributor

@joelbenway One little snag here is that it doesn't look gdb is supported on macOS (as reported by nix flake check --all-systems --no-build). If you can make adding that to the shell conditional on the OS, +1 from me.

Copy link
Contributor

@lucperkins lucperkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to make this more robust re: Linux vs. macOS

@lucperkins
Copy link
Contributor

Looks good to me. Could you rebase against main? It'll be good to go once that happens.

@joelbenway
Copy link
Contributor Author

Looks good to me. Could you rebase against main? It'll be good to go once that happens.

Should be ready to merge

@lucperkins lucperkins merged commit 615e7e8 into the-nix-way:main Apr 26, 2024
1 check passed
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.

4 participants