Nix integration

pedantix provides a flake. To add it as an input:

{
  inputs.pedantix.url = "github:swarsel/pedantix";
}

Packages

Per system, the flake exposes:

AttributeWhat it is
packages.${system}.pedantixThe bare binary. You must provide the base formatter (nixfmt/alejandra/nixpkgs-fmt) on PATH yourself.
packages.${system}.pedantix-wrappedA wrapper that bundles nixfmt, alejandra, and nixpkgs-fmt on PATH. This is what the flake app and all the modules use by default.

To install it system-wide:

environment.systemPackages = [ pedantix.packages.${system}.pedantix-wrapped ];

Or, to install via home-manager for a user:

home.packages = [ pedantix.packages.${system}.pedantix-wrapped ];

Note:

When using a drop-in replacement formatter (e.g. nixfmt-rs), you should either use the unwrapped package with your replacement package installed, or use your own wrapper. Then, set that formatter's name in your config as normal.

App

You can run pedantix directly from any system that has nix installed:

$ nix run github:swarsel/pedantix -- file.nix

Overlays

The following overlays are provided by the flake:

OverlayEffect
overlays.defaultAdds pkgs.pedantix and pkgs.pedantix-wrapped.
overlays.emacsAdds pedantix to every emacsPackagesFor set (works with e.g. emacs-overlay). See Emacs integration.

Modules

pedantix ships modules for some common Nix tooling. See the following table to learn which module you have to import for what:.

Purposeflake-parts moduleStandalone modulePage
treefmtflakeModules.default / flakeModules.pedantixtreefmtModules.defaulttreefmt
git-hooks / pre-commitflakeModules.git-hooksgitHooksModules.defaultPre-commit
home-managerhomeModules.default (homeManagerModules.default)Home Manager

There is also lib.emacsPackage, a function epkgs -> package for installing the Emacs package without the overlay — see Emacs.