add nixos stuff

This commit is contained in:
churl
2021-04-08 03:16:43 +02:00
parent 84817cea86
commit 25d68963b7
3 changed files with 50 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
eval "$(lorri direnv)"

32
default.nix Normal file
View File

@ -0,0 +1,32 @@
with import <nixpkgs> { };
with pkgs;
stdenv.mkDerivation {
name = "AntSimulator";
version = "dev";
src = lib.cleanSource ./.;
nativeBuildInputs = [
cmake
];
buildInputs = [
sfml
];
preBuild = ''
cmake .
'';
buildPhase = ''
make debug
'';
installPhase = ''
mkdir -p $out/bin
cp AntSimulator $out/bin/
cp compile_commands.json $out/
'';
enableParallelBuilding = true;
}

17
shell.nix Normal file
View File

@ -0,0 +1,17 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
mkShell {
nativeBuildInputs = [
gcc
gnumake
cmake
cmake-format
clang-tools
# ccls
];
buildInputs = [
sfml
];
}