Which package is mkfs in?

Hi,
I found myself needing to quickly create an ext4 filesystem on nix-darwin. Is there a specific nix package that contains mkfs.ext4? (I have an aarch64-linux remote builder set up).

Thanks!

Seems to live in e2fsprogs:

command-not-found mkfs.ext4
$ The program 'mkfs.ext4' is not in your PATH. You can make it available in an
ephemeral shell by typing:
  nix-shell -p e2fsprogs

And darwin even seems to be a supported output:

$ nix eval nixpkgs\#e2fsprogs.meta.platforms --json | jq '.[] as $k | $k' --raw-output|rg darwin
x86_64-darwin
i686-darwin
aarch64-darwin
armv7a-darwin

That command-not-found is a nifty thing to know about, thanks!
I guess I can enable it by putting the below in my flake:

config.programs.command-not-found.enable = true;

In the meantime, you’ve answered my original question - thanks very much :grinning_face_with_smiling_eyes:

It isn’t that easy on flakes, you either need to maintain a nixos channel owned by the root user that points to an actual upstream channel containing the cnf database (the nixos- prefixed ones).

Or use the flake-programs-sqlite as a flake input and make it the used database:

1 Like

Platforms is not a strong indication for “supported”. For example armv7a-darwin is not a thing to my knowledge. It could entirely be the case that unix was slapped on and so far no one used it on darwin.

“Supported” in the sense that nix will not complain about “unsupported system” and it will at least try to build :smiley:

I totally see why you are clarifying this here. And I really wish there was an easy way to check whether a certain attribute builds on linux and/or darwin on hydra…

there is https://github.com/nix-community/hydra-check

I’m aware, though it doesn’t eem to build nix for aarch64-darwin, which I know is a lie:

$ hydra-check --arch=aarch64-darwin nix
Build Status for nixpkgs.nix.aarch64-darwin on unstable
âš  This job is not a member of the latest evaluation of its jobset. This means it was removed or had an evaluation error.