Files
cf-autohover/shell.nix
2026-06-30 15:27:53 -07:00

44 lines
1.1 KiB
Nix

# Dev shell for building/running test-stand on NixOS.
#
# Provides the system libraries uv's venv can't: libusb (Crazyradio USB
# access via pyusb) and the GL/X11/font libs DearPyGui's bundled GLFW
# binary needs at runtime. Dependency management itself stays with uv —
# run `uv sync` then `uv run test-stand` as usual once inside this shell.
#
# Note: prebuilt-wheel binaries (e.g. dearpygui) won't load on NixOS at
# all unless `programs.nix-ld.enable = true;` is set system-wide, since
# their ELF interpreter expects a dynamic loader at a standard FHS path
# that NixOS doesn't provide by default.
{ pkgs ? import <nixpkgs> {} }:
let
libPath = pkgs.lib.makeLibraryPath (with pkgs; [
libusb1
libGL
libGLU
vulkan-loader
xorg.libX11
xorg.libXrandr
xorg.libXinerama
xorg.libXcursor
xorg.libXi
xorg.libXext
xorg.libXxf86vm
fontconfig
freetype
stdenv.cc.cc.lib
]);
in
pkgs.mkShell {
buildInputs = [
pkgs.python3
pkgs.uv
pkgs.libusb1
];
shellHook = ''
export LD_LIBRARY_PATH="${libPath}:$LD_LIBRARY_PATH"
export NIX_LD_LIBRARY_PATH="${libPath}:$NIX_LD_LIBRARY_PATH"
'';
}