nix-darwin currently does not support that directly, but there is an open PR to fix that. For my dotfiles, I added the module from the PR with some slight modifications. You can find the code below.
https://github.com/shinzui/dotfiles.nix/blob/master/modules/...