Skip to content

Commit 7399596

Browse files
committed
Add a nix flake for people on nixos
This is also very nice since it always supplies a known working version of the deps (xmake)
1 parent 092adb6 commit 7399596

File tree

2 files changed

+105
-0
lines changed

2 files changed

+105
-0
lines changed

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
description = "Tilted C++ development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs {
13+
inherit system;
14+
};
15+
in
16+
{
17+
devShells.default = pkgs.mkShell {
18+
buildInputs = with pkgs; [
19+
gcc14
20+
gdb
21+
libclang
22+
cmake
23+
xmake
24+
gnumake
25+
];
26+
27+
shellHook = ''
28+
# Unset environment variables, required for xmake to find
29+
# the linker/compiler that we provide here
30+
unset CC
31+
unset CXX
32+
unset LD
33+
unset AR
34+
unset AS
35+
unset RANLIB
36+
unset STRIP
37+
unset CFLAGS
38+
unset CXXFLAGS
39+
unset LDFLAGS
40+
echo "C++ development environment loaded"
41+
'';
42+
};
43+
});
44+
}

0 commit comments

Comments
 (0)