Remove pre-installed programs such as strace from system

I’m unsure how I could remove pre-installed programs such as strace from my system. I have no need for it on my minimal systems, and would like to save some disk space.

Thanks in advance
lom

similar to environment.systemPackages there’s also an environment.defaultPackages for things that should always be installed. you could override that with some of your own that you always want to have (including possibly none at all).

2 Likes

Thanks for the quick reply, that worked smoothly! One question though, why is perl one of them? Will anything break should I remove it?

1 Like

nixos depends on perl to boot, so removing it won’t save anything and may even break people’s scripts (since it’s often used in small shell scripts). if you can verify that nothing in your system uses perl from the global environment you can safely remove it, but your system won’t get noticably smaller.

1 Like

Maybe look at this GitHub - kisik21/nixos-super-minimal