File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 959959 } ;
960960 } ;
961961 nixfmt = mkOption {
962- description = "Deprecated nixfmt hook. Use nixfmt-classic or nixfmt-rfc-style instead. " ;
962+ description = "nixfmt hook" ;
963963 visible = false ;
964964 type = types . submodule {
965965 imports = [ hookModule ] ;
@@ -2143,10 +2143,19 @@ in
21432143 lib . optional cfg . hooks . rome . enable ''
21442144 The hook `hooks.rome` has been renamed to `hooks.biome`.
21452145 ''
2146- ++ lib . optional cfg . hooks . nixfmt . enable ''
2146+ ++ lib . optional ( cfg . hooks . nixfmt . enable && lib . versionOlder cfg . hooks . nixfmt . package . version "1.0" ) ''
21472147 The hook `hooks.nixfmt` has been renamed to `hooks.nixfmt-classic`.
21482148
21492149 The new RFC 166-style nixfmt is available as `hooks.nixfmt-rfc-style`.
2150+ ''
2151+ ++ lib . optional ( cfg . hooks . nixfmt-classic . enable && lib . versionAtLeast cfg . hooks . nixfmt-classic . package . version "1.0" ) ''
2152+ The hook `hooks.nixfmt-classic` is using an incompatible version of `nixfmt`.
2153+
2154+ Found: ${ cfg . hooks . nixfmt-classic . package . version } .
2155+ Expected: < v1.0
2156+
2157+ `hooks.nixfmt-classic` supports versions of `nixfmt` up to `v1.0`.
2158+ For `nixfmt` `v1.0` and newer, switch to `hooks.nixfmt`.
21502159 '' ;
21512160
21522161 # PLEASE keep this sorted alphabetically.
@@ -3402,8 +3411,8 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
34023411 } ;
34033412 nixfmt =
34043413 {
3405- name = "nixfmt-deprecated " ;
3406- description = "Deprecated Nix code prettifier. Use nixfmt-classic ." ;
3414+ name = "nixfmt" ;
3415+ description = "Official Nix code formatter ." ;
34073416 package = tools . nixfmt ;
34083417 entry = "${ hooks . nixfmt . package } /bin/nixfmt ${ lib . optionalString ( hooks . nixfmt . settings . width != null ) "--width=${ toString hooks . nixfmt . settings . width } " } " ;
34093418 files = "\\ .nix$" ;
You can’t perform that action at this time.
0 commit comments