[GLF-OS] Can't figure out how to remove some of the included programs

I’m new to Nix, and so far I know of only two ways to interact with packages:

  1. nix-env --uninstall firefox which results in
    warning: selector 'firefox' matched no installed derivations
    and no effect.
  2. configuration.nix - where one would include/remove packages - but no packages are listed there.

Could someone suggest how else they could be uninstalled?

1 Like

Seems like GLF-OS-specific options are documented here.

But… what do I do with them? I can find the files mentioned but they are part of read-only system, so I can’t edit them.

in your configuration.nix you can do

{
  # ...

  glf.firefox.enable = false; # disable firefox, comes enabled by default
}
2 Likes

Thank you, that works.
Is there a way to go more granular? For example, to remove Discord, which is among many that are part of packages.nix (glf.packages.enable).

There’s this GLF-OS/modules/default/packages.nix at d7326128d0c8579608a10bb6aa388fb5b9cd7812 · Gaming-Linux-FR/GLF-OS · GitHub

which means you can set glf.environment.edition = "mini"; to avoid discord. but also removes other packages in that list in the link above. and changes many other things.

removing packages from environment.systemPackages is not possible as of yet.

related Removing specific default packages in NixOS

It can only be done via forking glf-os repo, and keeping it up-to-date OR use pkgs.applyPatches and patch glf-os, see for eg. Support flake references to patches · Issue #3920 · NixOS/nix · GitHub, but doing this requires something called IFD which usually slows down nix commands.

or you can try disabling that module and maintain your own packages.nix module like here Removing system packages - #7 by SirGarry

none of these quite beginner friendly.

best make a issue upstream to request a packages.discord.enable option.

1 Like

The easiest way is probably to use vanilla NixOS without any “starter kits” or “opinionated” configuration…

2 Likes

Thank you again, I think this will work quite well. I can then simply re-add the few packages I need separately.

Eventually, yes, I plan to move to NixOS. For now, I need a distro that works out of the box, so I can learn it at my own pace. I actually made the attempt at NixOS first but Nvidia drivers simply refused to build and I haven’t had the time to figure out why. Already planning to go back to AMD, too, Nvidia is too much of a headache under Linux.