|
846 | 846 | };
|
847 | 847 | };
|
848 | 848 | nixfmt = mkOption {
|
849 |
| - description = "nixfmt hook"; |
| 849 | + description = "Deprecated nixfmt hook"; |
| 850 | + visible = false; |
| 851 | + type = types.submodule { |
| 852 | + imports = [ hookModule ]; |
| 853 | + options.settings = { |
| 854 | + width = |
| 855 | + mkOption { |
| 856 | + type = types.nullOr types.int; |
| 857 | + description = "Line width."; |
| 858 | + default = null; |
| 859 | + }; |
| 860 | + }; |
| 861 | + }; |
| 862 | + }; |
| 863 | + nixfmt-classic = mkOption { |
| 864 | + description = "nixfmt (classic) hook"; |
850 | 865 | type = types.submodule {
|
851 | 866 | imports = [ hookModule ];
|
852 | 867 | options.settings = {
|
@@ -1721,6 +1736,11 @@ in
|
1721 | 1736 | config.warnings =
|
1722 | 1737 | lib.optional cfg.hooks.rome.enable ''
|
1723 | 1738 | The hook `hooks.rome` has been renamed to `hooks.biome`.
|
| 1739 | + '' |
| 1740 | + ++ lib.optional cfg.hooks.nixfmt.enable '' |
| 1741 | + The hook `hooks.nixfmt` has been renamed to `hooks.nixfmt-classic`. |
| 1742 | +
|
| 1743 | + The new RFC 166-style nixfmt is available as `hooks.nixfmt-rfc-style`. |
1724 | 1744 | '';
|
1725 | 1745 |
|
1726 | 1746 | # PLEASE keep this sorted alphabetically.
|
@@ -2874,12 +2894,15 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
|
2874 | 2894 | builtins.toString script;
|
2875 | 2895 | files = "\\.nix$";
|
2876 | 2896 | };
|
2877 |
| - nixfmt = |
| 2897 | + # nixfmt was renamed to nixfmt-classic. |
| 2898 | + # The hook has been deprecated to free up the name for when the new RFC-style nixfmt becomes stable. |
| 2899 | + nixfmt = nixfmt-classic; |
| 2900 | + nixfmt-classic = |
2878 | 2901 | {
|
2879 |
| - name = "nixfmt"; |
2880 |
| - description = "Nix code prettifier."; |
| 2902 | + name = "nixfmt-classic"; |
| 2903 | + description = "Nix code prettifier (classic)."; |
2881 | 2904 | package = tools.nixfmt-classic;
|
2882 |
| - entry = "${hooks.nixfmt.package}/bin/nixfmt ${lib.optionalString (hooks.nixfmt.settings.width != null) "--width=${toString hooks.nixfmt.settings.width}"}"; |
| 2905 | + entry = "${hooks.nixfmt-classic.package}/bin/nixfmt ${lib.optionalString (hooks.nixfmt-classic.settings.width != null) "--width=${toString hooks.nixfmt-classic.settings.width}"}"; |
2883 | 2906 | files = "\\.nix$";
|
2884 | 2907 | };
|
2885 | 2908 | nixfmt-rfc-style =
|
|
0 commit comments