Listing running Nix builds
2025-01-08 (updated )
It isn't easy to get the builds currently executed by the Nix daemon. In a relevant Discourse thread, the wonderful nix-output-monitor was suggested. Whilst that tool is very nice, it has two drawbacks: you need to remember to use it and it only lists builds for one command.
To get all builds running on the system, use the following bash/zsh command. It requires parallel (from moreutils), pgrep, ripgrep, xargs (from findutils) and my own recursive-cpu-usage. (If not needed, you can remove that part in the first line.)
nd= && |
Example output:
0.0 httplib2 0.22.0
0.1 libpng 1.6.43
0.5 element-web 1.11.89
0.8 libnice 0.1.22
1.6 onnxruntime 1.18.1
2.7 seshat-node 2.3.3
23.0 qtlocation 5.15.16
The output is easily customizable to list other properties beyond the package name and version. For example, to list the name
instead you only need to replace pname|version
with name
in the command. Useful if you want to know which packages are cross-compiling.
0.2 aarch64-unknown-linux-gnu-rustc-1.83.0
0.2 element-web-1.11.89
2.3 openjdk-headless-17.0.13+11
2.7 onnxruntime-1.18.1
6.7 gtk4-4.16.7
7.7 qtwebengine-5.15.18
8.6 maturin-1.8.1
UPDATE: enhanced version with PID and time since build started.
Example output:
PID 3209181 9m 46s 1.8 qemu-9.2.0
PID 3552584 3m 24s 3.4 sleuthkit-4.12.1
PID 3580332 2m 43s 1.5 naja-0-unstable-2024-08-27
PID 3580604 2m 43s .5 naja-aarch64-unknown-linux-gnu-0-unstable-2024-08-27
PID 3602884 2m 2s 18.1 systemd-257.1
PID 3619809 1m 25s .2 nfs-utils-2.7.1
PID 3628731 1m 8s 1.9 libcxx-19.1.6
PID 3665614 1s .9 temurin-bin-23.0.0