building on nixos

This commit is contained in:
2026-06-30 15:27:53 -07:00
parent f8bb23e409
commit 5c13ac0ff9
3 changed files with 45 additions and 0 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use nix

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ __pycache__/
*.pyc *.pyc
cache/ cache/
.DS_Store .DS_Store
.direnv

43
shell.nix Normal file
View File

@@ -0,0 +1,43 @@
# 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"
'';
}