Skip to content

Commit

Permalink
Merge pull request #486 from cachix/fix-nixfmt
Browse files Browse the repository at this point in the history
fix: switch `nixfmt` to `nixfmt-classic`
  • Loading branch information
domenkozar authored Aug 20, 2024
2 parents bfef0ad + 515d252 commit 1064a45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2861,7 +2861,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
{
name = "nixfmt";
description = "Nix code prettifier.";
package = tools.nixfmt;
package = tools.nixfmt-classic;
entry = "${hooks.nixfmt.package}/bin/nixfmt ${lib.optionalString (hooks.nixfmt.settings.width != null) "--width=${toString hooks.nixfmt.settings.width}"}";
files = "\\.nix$";
};
Expand Down
8 changes: 7 additions & 1 deletion nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
, mdsh
, nil
, nixfmt
, nixfmt-classic ? null
, nixfmt-rfc-style ? null
, nixpkgs-fmt
, nodePackages
, ocamlPackages
Expand Down Expand Up @@ -131,7 +133,6 @@ in
mdl
mdsh
nil
nixfmt
nixpkgs-fmt
ormolu
pre-commit-hook-ensure-sops
Expand Down Expand Up @@ -201,4 +202,9 @@ in
checkmake = if stdenv.isLinux || checkmake.version >= "0.2.2" then checkmake else null;

headache = callPackage ./headache { };

# nixfmt was renamed to nixfmt-classic in 24.05.
# nixfmt may be replaced by nixfmt-rfc-style in the future.
nixfmt = if nixfmt-classic == null then nixfmt else nixfmt-classic;
inherit nixfmt-classic nixfmt-rfc-style;
}

0 comments on commit 1064a45

Please sign in to comment.