How to build a shell from flake for current system?

My understanding is that I can build a Flake default package for current system easily with:

nix build '.#default'

And I can start a default shell from devShell like this:

nix develop '.#default'

But what if I want to build a shell to then push it to a cache? I have to specify architecture:

nix build '.#devShells.x86_64-linux.default'

Am I missing something or is there no built-in way to build a given shell without hardcoding the architecture?

As far as I can tell the only sensible way of doing this is like this:

nixSystem=$(nix eval --raw --impure --expr 'builtins.currentSystem')
nix build ".#devShells.${nixSystem}.default" --print-out-paths

There’s no better way I’m missing?