As an alternative, you can follow the approach in the #guix #cookbook [1], which automagically takes care of everything for you. Even better, you may make use of #direnv [2] and its built-in "use guix" [3] to customise all project level related.
[1] https://guix.gnu.org/cookbook/en/html_node/Software-Development.html
[2] https://guix.gnu.org/cookbook/en/html_node/Environment-management.html
[3] https://raw.githubusercontent.com/direnv/direnv/refs/heads/master/stdlib.sh