FYI, you can skip step 1 by simply using bash's command substitution like so:
-------------------cut here---------------start------------------ export XDG_DATA_DIRS="$HOME/.guix-profile/share:$(echo $XDG_DATA_DIRS)" -------------------cut here---------------end--------------------