In #356221 nixpkgs removed `services.plausible.adminUser.*`
because Plausible upstream removed the ability to do that with an easy
CLI command, see:
https://github.com/plausible/analytics/pull/2357#issuecomment-4595200593
However, Plausible's default setup without automatic admin user creation
is unsafe for Plausible instances exposed to the Internet because it
offers a setup wizard, allowing anybody who can reach its webserver
to create the first admin users.
Plausible is usually exposed to the Internet, given that it is a web
analytics tool which must be web-reachable to function.
NixOS defaults configure it to listen only on `localhost`, which is
already good, but on NixOS it generally makes sense to be able to
configure services declaratively so they work out of the box on
first deploy. Workarounds such as "deploy first binding
only to localhost, manually do the setup wizard, then deploy another
config to expose it" are annoying.
Thus, this commit adds back the original declarative `adminUser`
implementation, doing the needed DB changes directly, race-free,
and with better security (allowing to configure a password has instead
of a plain-text password).
Assisted-By: Zoo Code with Claude Opus 4.8, human review