Current status of Perl removal from the base system

I have been trying to minimize my NixOS install to just the bare minimum and offload packages to my own custom modules.

I was a little surprised to find that I can’t seem to remove perl from my PATH (there seems to be something that installs perl into my system PATH). That led me down a rabbit hole that seems to end at Perlless Activation - Tracking Issue · Issue #267982 · NixOS/nixpkgs · GitHub .

I was happy to find a perlless.nix profile that I thought I could use. I couldn’t, actually, because it forbids anything Perl-related in my nix store path (even a .perlcriticrc file), but this is beside the point.

My actual question is: it seems like Perl is still being used in the default NixOS activation script (I am on 25.11). Why is the Perlless nix tracking issue marked as closed? Is there no more ongoing work to remove Perl from the activation script or change to an implementation that does not use Perl at all?

2 Likes

The actual activation logic should be perlless, as documented in the linked issue. Are you perhaps running into the default value of environment.defaultPackages?

You can set that option to [] to get rid of perl, rsync and strace

2 Likes

That was it!

I did not know that option existed. Once I set its value to [ ], Perl is gone from my PATH. One step closer to a cruftless system :grin: ~ thanks!

Perhaps an aside: what’s the rationale behind adding those three packages to environment.defaultPackages? Isn’t it cleaner to just start with no default packages?

Historical mistake, and removing it without a proper warning would cause a bit of disruption for people expecting it to be present. I think it will get removed eventually.

7 Likes