# Formatter and Checks This note covers `16-formatter-and-checks/`, which exposes `formatter.` and a small `checks..*` derivation that uses the same formatter. --- ## 1. Why These Outputs Matter Two flake outputs are especially practical in day-to-day use: - `formatter.`, which powers `nix fmt`, and - `checks..*`, which powers `nix flake check`. This example keeps both outputs small so the wiring is obvious. --- ## 2. The Important Connection The flake points `formatter.` at `pkgs.nixfmt`, then reuses that same formatter in a check: ```nix formatter.${system} = pkgs.nixfmt; ``` That shows the main idea: a formatter output is just another derivation, so checks can use it too. --- ## 3. Commands to Try ```bash cd 16-formatter-and-checks nix fmt sample.nix nix flake show nix flake check ```