Ho, some of us think alike. I stumbled onto this site while looking up related unshare namespace configuration. I do something similar.
Different words similar meaning?
--references
is NixOS speak for direct
package dependencies.
--requisites
list all. These work with the
nix-store
command.
$ readlink --canonicalize "$(type -P which)"
/nix/store/r78jv9xgxnvsm5vpasf5ldkc28pkri6r-which-2.21/bin/which
$ nix-store --query --references /nix/store/r78jv9xgxnvsm5vpasf5ldkc28pkri6r-which-2.21
/nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163
which
directly depends on
glibc
. Swap --references
to
--referrers
for paths pointing to which
.
On Guix, list/draw dependencies with
guix graph
.
guix graph --type=references which
I’ve had a draft post of Guix notes written up for a while now. Did you know that it’s easy to generate a file system specified from a config.scm? It’s somewhat equivalent to nixos-install, pacstrap and the like.
guix system init --no-bootloader config.scm filesystem/
Why? Commands like this are handy for messing around with chroots, containers, and other related stuff!
Look at this Makefile — then look at this NixOS package derivation. Appears simple but I couldn’t for the life of me divine how to quickly compile a custom/patched kernel module on NixOS. Abstractions… are very magical. The guide is cool and all, but it’s a better time investment to guesstimate the relationship between the higher/lower layer. This friendly example looks more like this in reality though ;-)