9 or 20 lines of nixos vs 7 steps on another OS vs some copy/paste with docker. It's not very convincing
You pay a higher upfront cost, but you end up with declarative code which has advantages for maintenance.
With NixOS, rollbacks from changes to system state are trivial; and the whole system is configured from a single starting point, which makes it easy to track down why things are a certain way.
For a personal workstation, it's not necessarily a practical trade-off.
It's even better with flakes. I can keep dozens of projects on-disk, and their dev environment is always versioned + synced with my workstation. I've torched entire weekends trying to get the same workflow out of direnv and pamac/homebrew. On Nix systems, it all lives in one or two git-synced files.