Put this in a vim buffer and in command mode run :w !bash
to execute buffer contents via bash:
If you get something along
/nix/store/61mibb0k5mxnsxzb4x2737cbysn4c5ha-home-manager/bin/home-manager: line 71: NIX_PATH: unbound variable
check if you have run this already:
. ~/.nix-profile/etc/profile.d/nix.sh