Installing gnome also installs a lot of default applications, sometimes you may want to use different applications instead in which case the gnome native applications can get a little annoying.
Luckily there is a config option to disable them.
Below is an expression that disables them all with comments describing their function:
environment.gnome.excludePackages = with pkgs.gnome; [
baobab # disk usage analyzer
cheese # photo booth
eog # image viewer
epiphany # web browser
gedit # text editor
simple-scan # document scanner
totem # video player
yelp # help viewer
evince # document viewer
file-roller # archive manager
geary # email client
seahorse # password manager
# these should be self explanatory
gnome-calculator gnome-calendar gnome-characters gnome-clocks gnome-contacts
gnome-font-viewer gnome-logs gnome-maps gnome-music gnome-photos gnome-screenshot
gnome-system-monitor gnome-weather gnome-disk-utility pkgs.gnome-connections
];
Finally there also is pkgs.gnome.gnome-terminal, but disabling that might lock you out of your system.
Yeah, found that in the documentation, however I wanted some of those applications, but to remove only the ones I didnāt want was hard, because I couldnāt find their names anywhere I searched!
@Thiago-Assis-T@busti this may be worthwhile to add to the NixOS manual, where it belongs. Ping me if you need any help with making a pull request. Or at least you could open an issue and link to this thread.
The issue is that apps predating GNOMEās current naming policy often have an internal name with no obvious connection to the application name. For example, an app called Archive Manager everywhere in its user interface is actually a File Roller originally, and the attribute name reflects that.
To find out the attribute name, you first need to discover the internal name. The following options immediately come to my mind:
Click the website link in the About dialogue
Press Alt-F2, type lg and press Enter to open GNOME Shellās Looking Glass interface, then find it based on the icon in the Windows tab.
Run xprop program on the terminal and click the Archive Manager window. Then notice the value of the _GTK_APPLICATION_ID property. (Probably will not work on Wayland.)
Press Control-Shift-I to open GTK inspector, view the application ID in the General tab.
But if a person is aware of those methods, they are probably familiar enough with GNOME to already know the app name.
Then you can search it on NixOS Search. to discover the attribute name.
@jtojnar I indeed thought about making that list or your methods explicit in the manual, or some other type of convenience such as adding attribute name aliases to help with that sort of discoverability. The manual currently only shows there is a mechanism, not how to make use of it.
indeed, this worked like a charm, I didnāt know about this beforeā¦
even though the names were on the thread, it is good to learn about this, because I wasnāt able to find the internal name of the apps.
Thank you very much!
FYI: If anyone else runs into an āundefined variableā error on āgnome-photosā when building the nix config after making this change, I was able to resolve that by changing it to āpkgs.gnome-photosā
Thereās also the āpkgs.gnome-text-editorā and āpkgs.gnome-tourā apps that people might consider removing.
with pkgs.gnome; [
adwaita-icon-theme
# nixos-background-info This can't be excluded since it's defined locally. So even if we removed all GNOME backgrounds it seems we have to keep the NixOS one.
gnome-backgrounds
gnome-bluetooth
gnome-color-manager
gnome-control-center
gnome-shell-extensions
gnome-themes-extra
pkgs.gnome-tour # GNOME Shell detects the .desktop file on first log-in.
pkgs.gnome-user-docs
pkgs.orca
pkgs.glib # for gsettings program
pkgs.gnome-menus
pkgs.gtk3.out # for gtk-launch program
pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
baobab
epiphany
pkgs.gnome-text-editor
gnome-calculator
gnome-calendar
gnome-characters
gnome-clocks
pkgs.gnome-console
gnome-contacts
gnome-font-viewer
gnome-logs
gnome-maps
gnome-music
gnome-system-monitor
gnome-weather
pkgs.loupe
nautilus
pkgs.gnome-connections
simple-scan
pkgs.snapshot
totem
yelp
];
After disabling many unused apps looks like GNOME still works well, except that the control center has some issues. After disabling gnome-online-accounts, the corresponding panel has no icons anymore. And the sharing panel freezes the program. It seems I can disable the panel by removing the corresponding desktop files but I donāt know how to do that without patching and rebuild the control center.
I would really advise against disabling core services unless you want to deal with a partly broken system. Even though system will probably run if you disable some of them, it is untested configuration and some components may spam logs with errors, include unusable UI or even crash.
The sessionPath is a hack needed for some of the extensions to load properly with NixOS filesystem hierarchy.
Packages are immutable so you will either need to patch and rebuild, or create a new derivation copying the files from the old one and replacing all the references to old derivationās outputs with the new oneās.
current-system is just another immutable package that symlinks stuff in environment.systemPackages (built with buildEnv).
You could inject extra code to environment.extraSetup NixOS option to remove the desktop files from the symlink tree. But that might require manual reification of symlinks if you are unlucky and the files you want to remove are inside a symlink to a directory in another package. And it will not help you if a package looks directly to g-c-c Nix store path, you would need to update the references in the package. At that point, you might want to use system.replaceRuntimeDependencies hack but that is a bit tricky.
Alternately, you could install a package with higher priority to environment.systemPackages, that would contain a dummy version of the files you want to remove. But again, that will not work if a package looks directly to g-c-c Nix store path.
Anyway, this is getting off-topic so please open a new thread if you want discuss this avenue further.