Settings

Theme

Show HN: Nixwrap – Run Nix packages from Python without Nix installed

github.com

2 points by eloh 3 months ago · 0 comments · 1 min read

Reader

I built a tool that lets you run any package from nixpkgs without having Nix installed on your system.

uvx nixwrap ripgrep --version uvx nixwrap jq --help uvx nixwrap bat README.md

How it works: 1. Queries nix-index-database to find packages 2. Fetches NARs from cache.nixos.org 3. Uses patchelf to fix binaries with hardcoded /nix/store paths 4. Runs via bundled ld-linux with the correct library path

There's also a PEP 503 package index, so you can install tools via pip/uv:

uvx --index-url https://elohmeier.github.io/nixwrap fd --version

Requires Python 3.14+ (uses stdlib compression.zstd for zero external dependencies). Linux only for now.

Works great for simple CLI tools. Complex packages with hardcoded runtime paths (like neovim) have limitations.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection