Since this is highly specific to nix-store --serve, it seems better to keep it in nix-store.cc.