To be honest, I consider it a big plus of
nix, to not force everyone to be on the same version.
But if OP really wants to, I’m pretty sure it will just work when they provide a systemd timer + service, that does run the exact two commands from the OP.
I’d still never suggest to do unsupervised updates. If stuff breaks, its hard to find out why and when that happened.
Besides of that,
nix-env -i doesn’t really work for a lot of things, as further tweaking of configuration is required through nix, or by hand, where other package managers might do more “magic” behind the curtains when installing stuff.
nix-env -i won’t setup systemd units, it won’t add users necessary to run services, it won’t configure anything. To achive those installations properly one needs to describe them declaratively in a nix file at a central place or per project in a
shell.nix and this still doesn’t work for all programs (postgres database in a
shell.nix? Not sure how that should work…)
snap, or even
brew might be in an advantage here, as they take care for such stuff in their imperative forms.
snap even does automatic updates, no need to ask for it… It will break totally on its own… Without user interaction, isn’t that progress?