Include git in minimal ISO?

Is there a particular reason why git is not included with the minimal ISO?

It appears the community is moving strongly towards flakes - even if it is experimental still, it seems to be, at the least, a significant part of Nix’s future. Therefore, doing what is possible to support flakes as a first class citizen seems wise. For someone like me, my default workflow to install NixOS would ideally be downloading the miminal ISO from Download Nix / NixOS | Nix & NixOS, booting up, and using nixos-install --flake ... with my custom flake to install my system on the machine. Unfortunately, this isn’t possible out of the box since git isn’t installed on the minimal ISO.

You can, of course, add it on your own. My question is, why not include support for this out of the box, to avoid the extra middle steps of either 1) building your own ISO with git included instead of downloading an ISO from the official page or 2) doing a standard installation and then doing the extra work to convert over to a flake-based installation.

Again, not the worst thing in the world, but you’d think if flakes were a first-class citizen, you’d support them out of the box on your distribution’s minimal ISO.

So, if I’m misguided or not fully informed, teach me why. Otherwise, I’m inclined to submit a PR to nixpkgs to include this.

New to NixOS, but have spent a decent amount of time reading documentation and playing with it, and couldn’t figure this out


I agree with the sentiment, but for the time being you can just use ‘‘nix-shell -p git’’ and start your installation from there.


Without knowing for sure, I think the purpose of the minimal system image is to be truly minimal. Whether it’s practical not to have Git included is a different question. I suppose it’s worthwhile to open a PR after checking for prior art and collecting some evidence and arguments, since maintainers are easier to get in touch with on GitHub directly.

“Miminal” is a moving target in my opinion, hence the post. For example, do you really need cd in a minimal ISO? You could just use absolute paths to explore the file system. That’s an extreme example, but it illustrates that minimal generally means “enough tools to minimize friction for a simple install”. Which is, of course, vague. I think it’s fair to suggest that git is as helpful to a flake-based installation as cd is.

Not to mention, an ISO should be complete. That is, the included binaries should have all their dependencies. git is a dependency of nixos-install with the flake option, so it should be included.


Sounds reasonable, I’d support a PR.

1 Like

This is my workflow as well, but I am realizing that it might not be the best one for this use-case. Ideally, I’d use my existing flake to build an ISO already tailored to my configuration, so that, during installation, I don’t need internet access at all, because the ISO already contains the flake and its store I am going to install. I know that in theory “build your own ISO” is possible, but I don’t think this approach is well documented and advertised yet.

1 Like