Skip to content

Commit

Permalink
Add a nix flake for people on nixos
Browse files Browse the repository at this point in the history
This is also very nice since it always supplies a known working version of the deps (xmake)
  • Loading branch information
Force67 committed Nov 26, 2024
1 parent 092adb6 commit 7399596
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "Tilted C++ development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
gcc14
gdb
libclang
cmake
xmake
gnumake
];

shellHook = ''
# Unset environment variables, required for xmake to find
# the linker/compiler that we provide here
unset CC
unset CXX
unset LD
unset AR
unset AS
unset RANLIB
unset STRIP
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
echo "C++ development environment loaded"
'';
};
});
}

0 comments on commit 7399596

Please sign in to comment.