So you installed Ubuntu in a virtual machine, you installed the Nix package manager on it, and you would like VirtualBox's guest additions installed thanks to the Nix package manager.
The attribute name of the package you are looking for is
linuxPackages.virtualboxGuestAdditions. Thus, you can install it by issuing:
nix-env -iA linuxPackages.virtualboxGuestAdditions -f '<nixpkgs>'
I'm not sure though if the package will actually work on Ubuntu, because it's description hints that it is a NixOS-only package:
Various add-ons which makes NixOS work better as guest OS inside VirtualBox. This add-on provides support for dynamic resizing of the X Display, shared host/guest clipboard support and guest OpenGL support.
Indeed, the Nix package manager is useful to install userspace applications on other distributions but if you also want Nix to handle system modules, you have to switch to NixOS for that (then the correct way to enable guest additions is through
virtualisation.virtualbox.guest.enable option which you can set in your
/etc/nixos/configuration.nix as is described in the manual).
As a side-note, what you put in
~/.nixpkgs/config.nix does not make much sense. This file is for configuring the Nix package manager itself, allowing non-free packages or overriding existing package. You won't need to override any package in your case. And you don't need either to allow non-free packages because VirtualBox's guest additions is registered as GPL.