Module XFCE has no excludePackages?

In my previous question @jtojnar mentioned that I could use the whole Xfce module and disable the parts I do not like. But the Xfce module seems not to have an option excludePackages like Mate and LxQt, etc.
Is there another option I could use?

Afte some further research I came across an option like:

environment.systemPackages = with pkgs; utils.removePackagesByName [
    <package_to_remove>
];

This won’t work becouse there already is an environment.systemPackages in the configuration file.
So I have tried combining them, but no luck so far.

Any hints on how to use this or where I can find more info on how to get is working?
There is no information available on NixOS Search - Options

utils.removePackagesByName expects two lists and removes items from the second one from the first one. You cannot use it to modify options already set in different module. And even if you could somehow do

environment.systemPackages =
  lib.utils.removePackagesByName
    cfg.previous.environment.systemPackages
    [
      <packages_to_remove>
    ];

which I do not think is possible, you would need to use lib.mkForce to prevent the merge semantics to just appending the filtered list to the previous one.

In my previous answer I forgot that Xfce still lacks excludedPackages option. I would suggest opening a PR against Xfce module to introduce it, and possibly also group options like GNOME has so that user can disable e.g. all default apps at once.

1 Like

Thanks, I will look into that. But I will have to look at how to extend and test the xfce module and at the rules for a pull requests first.