RSSAmplifier

Blog

n8henrie.com

Technology, medicine, science, superstition... and having fun. Brought to you by Nathan Henrie.

n8henrie.comRSS feed ↗10 posts

Latest posts

Nix: Debugging MacOS / Darwin Sandbox Issues

Bottom Line: Filtering the macos logs for sandbox violations can help flesh out the root cause of sandbox-related crashes when building with nix. I recently started getting some unexpected build failures when trying to rebuild my nix-darwin system: $ nix build -v --print-build-logs github:nixos/nixpkgs/2bdc7039afa38f4330de69360a817e11f7e2f2c5#mpv-unwrapped ... mpv> buildPhase completed in 38…

How to Set a Conditional Breakpoint When Debugging Rust with LLDB

Bottom Line: A little Python can help LLDB break on String contents in Rust. A few months ago I was trying to debug some Rust code that was misbehaving. The bug was in a function that was run hundreds of thousands of times, but I had made a logic error somewhere that only seemed to manifest in a very small fraction of the cases. I had gathered a few examples that were reliably misbehaving, so I…

Nix: Why Does My System Depend on $PKG?

Bottom Line: nix why-depends --derivation /run/current-system and nix derivation show --recursive /run/current-system are handy. NixOS and nix-darwin users – especially those following unstable – will be familiar with the situation of nixos-rebuild or darwin-rebuild failure due to breakage in a dependency. (Said user will hopefully also be grateful that this failure prevents them from switching…

Compiling Rust for the ESP32 with Nix

Bottom Line: Nix’s tooling for Rust compilation can target the ESP32. Preface This is a fairly long, meandering post about using nix to compile a no_std Rust project for the ESP32C3. I was able to get things working eventually, and I try to recreate the process that took me there, including several mistakes along the way. Many of the error messages that I encountered seemed quite obscure and had…

Cross-Compile Rust for x86 Linux from M1 Mac with Nix

Bottom Line: Nix makes cross-compiling Rust fairly straightforward. I have been tinkering with using nix to build Rust projects over the last couple of weeks and decided to try my hand at cross-compiling Rust for x86_64-linux from my M1 Mac (aarch64-darwin) via nix. Currently, several of my machines are running various flavors of NixOS (several aarch64-linux Raspberry Pis, a few x86_64-linux…

Hacking on nixpkgs with nix develop

Bottom Line: Failing to add MPS support to nixpkgs.python310Packages.torch. I’ve been using nix / nixpkgs / NixOS on and off for a year or two now. I’ve been genuinely impressed at how open and welcome the community is to contributions, so I’d like to start taking advantage of that by contributing back. I’m writing this post as I go, in the spirit of this (highly recommended) series:…

Write a Firefox Extension in Python

Bottom Line: One can write a Firefox extension in (mostly) Python via Pyodide. Disclaimer: I’m not a huge fan of JavaScript, and I don’t use it much, so I am likely not following best practices. I’ve also never written a Firefox extension, so the below is pretty bare-bones, but hopefully enough to get you off the ground. With the recent amazing advancements in Python and wasm, brought to us in…

Persistent VMs on pfSense with vm-bhyve

Bottom Line: Configure your VMs to start and run automatically on pfSense with vm-bhyve. 20251104 Update : Changed /boot/loader.conf to /boot/loader.conf.local thanks to @gmipf, based on https://docs.netgate.com/pfsense/en/latest/config/advanced-tunables.html If you’re trying to get a Linux VM running under bhyve on pfSense, I strongly recommend that you start with my first post on the topic .…

Running NixOS and Ubuntu VMs on pfSense via bhyve

Bottom Line: With some effort, I got VMs running on my pfSense router/firewall. Preface Being a hobbyist without much experience in networking, this project took me a fair amount of effort over a period of weeks. It is mostly proof-of-concept, and I think there are good reasons not to use your firewall to host virtual machines. I’m sure this could impair performanc or even compromise the security…

Quickly add FreeBSD Packages to pfSense

Bottom Line: I wrote a bash function to add packages directly from FreeBSD to pfSense. Disclaimer: Modifying your firewall is a security risk. Please don’t use the information on this page unless you know what you are doing and are willing to accept the consequences for yourself and anyone on your network. I’ve been happily using pfSense for a year or so now. I am getting more comfortable with…