Move to flakes, and clean the scripts.

This commit is contained in:
kidrigger 2025-02-05 11:03:41 +01:00
parent 564f6cc205
commit 0f868ef74e
6 changed files with 126 additions and 4 deletions

2
.envrc
View File

@ -1 +1 @@
use nix use flake

View File

@ -1,7 +1,12 @@
#!/usr/bin/bash #!/usr/bin/env bash
echo "Running CMake" echo "Running CMake"
cmake --preset=default if grep 'NAME=NixOS' /etc/os-release
then
cmake --preset nixos
else
cmake --preset linux
fi
echo "Running Ninja" echo "Running Ninja"
if echo "$@" | grep -e "clean" -q if echo "$@" | grep -e "clean" -q

1
compile_commands.json Symbolic link
View File

@ -0,0 +1 @@
build/compile_commands.json

61
flake.lock Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1738734093,
"narHash": "sha256-UEYOKfXXKU49fR7dGB05As0s2pGbLK4xDo48Qtdm7xs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5b2753b0356d1c951d7a3ef1d086ba5a71fff43c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

55
flake.nix Normal file
View File

@ -0,0 +1,55 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
eabase = pkgs.callPackage ./vendored-nix/eabase {};
eastl = pkgs.callPackage ./vendored-nix/eastl { inherit eabase; };
tinygltf = pkgs.callPackage ./vendored-nix/tinygltf {};
debugbreak = pkgs.callPackage ./vendored-nix/scottt-debugbreak {};
in
with pkgs;
{
devShells.default = clangStdenv.mkDerivation {
name = "BlazeEnv";
nativeBuildInputs = [
cmake
ninja
ccls
(imgui.override {IMGUI_BUILD_VULKAN_BINDING = true; IMGUI_BUILD_GLFW_BINDING=true; })
];
buildInputs = [
sdl3
glm
glfw3
eastl
fmt
eabase
eastl
entt
tinygltf
debugbreak
stb
# vulkan
vulkan-headers
vulkan-loader
vulkan-validation-layers
vulkan-memory-allocator
directx-shader-compiler
glslang
shaderc
];
};
}
);
}

2
run.sh
View File

@ -10,5 +10,5 @@ if [ -d "build" ]; then
fi fi
popd > /dev/null || exit popd > /dev/null || exit
else else
echo "Build blaze first." echo "Build Aster first."
fi fi