Changing programs used to launch an Application in Gnome3

GNOME respects mime-apps-spec so you would just set the default application in $XDG_CONFIG_HOME/mimeapps.list, just like on any other distribution. If you want to set it system-wide, you could add something like the following to your configuration.nix:

environment.variables.XDG_CONFIG_DIRS = [ "/etc/xdg" ]; # we should probably have this in NixOS by default
environment.etc."xdg/mimeapps.list" = {
  text = ''
    [Default Applications]
    mime/type=foo.desktop;
  '';
};