I use a variation of that setup, I install plain neovim as a package, and symlink the neovim config: https://github.com/davidmh/dot-files/blob/main/home.nix#L115-L118
Mostly because I want to manage the neovim plugins with lazy.nvim, not with nix derivations.
I use something simpler in my config that runs on
BufWritePost
:silent !svgo %
I wrote that right after reading this koan:
https://blog.sanctum.geek.nz/vim-koans/