Nix-health: Check the health of your Nix environment

Nix flakes are great for giving reproducible dev environments, but we also wanted to run a few environmental “checks” along that for newcomers to a flake-managed project. Such as whether max-jobs is set to an appropriate value, or whether you are accidentally using Rosetta emulation of Nix or whether direnv is being used.

So, here’s a program that does that: nix-health

The checks can be customized in the project’s flake.nix. For eg., projects that use direnv can indicate that developers must have direnv installed and activated.

nix-health.default = {
  nix-version.min-required = "2.16.0";
  caches.required = [ "https://cache.garnix.io" ];
  direnv.required = true;
  system = {
    # required = true;
    min_ram = "16G";
    # min_disk_space = "2T";
  };
};

Support for custom checks is planned for the future.

nix-health is available in nixpkgs; you can run it using nix run nixpkgs#nix-health.

9 Likes

nix-health now lives under GitHub - juspay/nix-health: Check the health of your Nix install

nix-health v0.3 is out!

1 Like