Hello,
Nix alone won’t be able to do that since it can only write in /nix/store/.
If you want to achieve such a thing, you could:
- Create a script built by Nix, that once built in
/nix/store/..., you execute it and do what you want. - Use Home Manager and use
home.file(see Deploy files into home directory with home-manager, nixos-x260/hosts/lw196205087/home.nix at 7474d08c1b80157ae8b4999b411d0db18cc2aba3 · drupol/nixos-x260 · GitHub, How to manage dotfiles with home-manager?)