Add Nix development shell in flake and direnv support with 'use flake' (#58)

Direnv allows the project environment to be automatically applied when
the project is cd'd into.

Other notable changes:
- .gitignore: add .cache and .direnv generated by clangd and direnv respectively
This commit is contained in:
techs-sus authored and GitHub committed 2026-08-24 23:49:04 +03:00
1 parent 0f635abc25
commit 21efe88b22
3 files changed
+40 -2

No files matched your search

+1
View File
@@ -0,0 +1 @@
use flake
+6
View File
@@ -20,6 +20,12 @@ Testing/
CMakeUserPresets.json
*.cmake.user
# local direnv development shell cache
.direnv/
# clangd cache
.cache
*.o
*.obj
*.a
+33 -2
View File
@@ -1,5 +1,5 @@
{
description = "Description for the project";
description = "Experimental Roblox compatibility runtime for Linux and FreeBSD";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
@@ -23,8 +23,39 @@
pkgs,
...
}:
let
package = pkgs.callPackage ./packaging/nix/package.nix { };
in
{
packages.default = pkgs.callPackage ./packaging/nix/package.nix { };
packages.default = package;
devShells.default = pkgs.mkShell {
inputsFrom = [ package ];
# nixpkgs installs the header we need under include/libutf8proc
NIX_CFLAGS_COMPILE = "-I${pkgs.libutf8proc}/include/libutf8proc";
nativeBuildInputs = with pkgs; [
cmake
git
lld
ninja
pkg-config
vulkan-headers
llvmPackages_22.clang-tools
llvmPackages_22.libclang
# debugging
gdb
];
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath package.buildInputs}"
# nix packages graphics drivers differently, and mocktail will still work if it cannot guarantee symbols
export MOCKTAIL_REQUIRE_REAL_GRAPHICS=0
'';
};
};
flake = { };
};