Installing Home Manager as a module in 23.05 leads to infinite recursion

I’m installing Home Manager as a module as described in Home Manager - NixOS Wiki

Link to my config: machines/configuration-petrosilia.nix at e1461a4039eb9617d6fc2f9f746714610990e649 · jheidbrink/machines · GitHub

Now I want to upgrade NixOS to 23.05. I adapted the channels and the home-manager rev and called nixos-rebuild switch --upgrade which gives my an infinite recursion error. The output when run with --show-trace suggests that the way I add home-manager is the culprit:

       at /etc/nixos/configuration-petrosilia.nix:21:8:

           20|       ./machines/petrosilia/hardware-configuration.nix
           21|       (import "${home-manager-tarball}/nixos")
             |        ^
           22|       ./modules/shared_config.nix

       … while evaluating 'isFunction'

(full output is at nixos_with_homemanager_as_module-infinite_recursion.txt · GitHub)

Does someone use home-manager this way with 23.05 and got it working?