Changing programs used to launch an Application in Gnome3

How can I changed the programs used to launch the application that runs in terminal (i.e. Terminal=true) in gnome3 de? This may not related to nixos but all the answer I found talked about solutions for ubuntu or some other distros and none of them worked for nixos…

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;
  '';
};

thanks for your reply but I can’t find a correct mime type. e.g. the nvim.desktop has Terminal=true and several MimeTypes. Tried to set them in mimeapps.list, i.e. :

[Default Applications]                                                                                                                                                               
application/x-shellscript=termite.desktop 

but will still open a xterm window

Hmm, I misunderstood your question.

Changing the default terminal is currently not possible, because
desktop-entry-spec
defines no such thing, and glib refuses to implement non-standard
hacks
.

Since the codebase checks for several pre-defined
terminals
,
I guess the only solution would be to create a symlink from one of them
to your emulator of choice.