barebone cpp development shell based on nix flakes
nix
with flake
support
to enable it, given nix is installed:
mkdir -p $HOME/.config/nix
cat <<'EOF' >> $HOME/.config/nix.conf
experimental-features = flakes nix-command
EOF
alternatively, add the following alias to your shell:
alias nix='nix --arg experimental-features='nix-command flakes'
default shell can be entered using:
nix develop github:ink-splatters/cpp-shell
there are 3 more shell types:
#O3
( adds-O3
toCFLAGS
andCXXFLAGS
)#unhardened
( disables hardening using hardeningDisable#O3-unhardened
( self explanatory )
all the shells feature:
-mcpu=apple-m1
if applicable- LDFLAGS=
-fused-ld=lld
nix develop github:ink-splatters/cpp-shell#O3
git clone https://github.com/ink-splatters/cpp-shell.git
cd cpp-shell
nix develop .#O3-unhardened
optionally, the following tools can be installed nix profile
- wise:
lldb
clang-format
,clangd
and more tools included in nixclang-tools
package
to install it:
nix profile install github:ink-splatters/cpp-shell#cpp-tools
More advanced nix
-based alternatives which support wider range of tools and options: