File utility not included in base NixOS install

I was surprised to find out that the file utility is not installed by default on NixOS systems.

Considering that it’s definitely a standard utility on Debian (and derivatives) and macOS, and probably on many more distros, has its inclusion by default been considered for NixOS?

If so, where would it fit? utilLinux?

If not, is there a NixOS-specific reason?

Definitely file, that’s where everyone expects to find it.

And sorry, file is not an ‘essential’ package in debian, not even close. It is included in ‘standard’ task, but that designation does not really mean anything. There should be a line that separates the default package set from our blurry notion of what constitutes ‘standard utilities’. Debian has two lines, NixOS has one and I’m totally fine with that line excluding ‘file’.

I think there might be a NixOS-specific factor: a dependency of a command/daemon doesn’t necessarily need to be in the global $PATH.

Is there a community policy that the NixOS baseline is the bare minimum for POSIX plus Nix functionality ? Or a clear enunciation of what the baseline is?

1 Like

file is not a dependency of anything standard in NixOS, judging from my experience. You can have stdenv, a default installation or a full-blown desktop with KDE without anything pulling it in, even indirectly.

Yes I think there is unspoken agreement, that the “base” system you get when you don’t specify anything in environment.systemPackages explicitly, is as minimal as it can be.
It is easy to build on this clean sheat by putting things into your configuration, while it would be rather hard to get rid of things, if they were included by default.

In fact even just satisfying Posix can be quite a nuisance, as witnessed by the /bin/sh problem.