this post was submitted on 12 Mar 2026
9 points (90.9% liked)

Nix / NixOS

2737 readers
2 users here now

Main links

Videos

founded 2 years ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[โ€“] ruffsl@programming.dev 3 points 2 months ago (1 children)

I really appreciate the comma command.

[โ€“] hallettj@leminal.space 5 points 2 months ago

The comma command is magic! Of course I use it often to run something that I don't feel like I need listed in my main config - especially a command that I just want to run once. But there are also plenty of cases where I do want to add a package to a config, and I know the command that I want, but I don't know which package it comes from. The comma is a real easy way to find out.

I haven't watched the video - maybe these tips are already in there. If you run a command like , dig you'll often be prompted to choose which package to get the command from, if the same command is provided by multiple packages. So that's one way to get a package name. If you don't get that prompt you can use comma as a lookup tool like this:

$ , --print-packages dig
Packages that contain /bin/dig:
- dig.dnsutils
- bind.dnsutils

Or you can ask comma to show you the path of the executable it would run, and infer the package name from the path:

$ , --print-path dig
/nix/store/qm1hvm2hfryx7xz9k3njsb6gksvs29is-bind-9.20.18-dnsutils/bin/dig

The Nix store path format is /nix/store/<hash>-<pname>-<version>-<output> so that is the dnsutils output of bind, which is bind.dnsutils.

So that gives me package names I can put in my NixOS config, or devshell, or whatever. In this case I could install any of dig, bind, dig.dnsutils, or bind.dnsutils. (They all end up pointing to that binary in bind.dnsutils.)