|
2 | 2 | let |
3 | 3 | inherit (config) hooks tools settings; |
4 | 4 | cfg = config; |
5 | | - inherit (lib) flatten mapAttrs mapAttrsToList mkDefault mkOption mkRemovedOptionModule mkRenamedOptionModule types; |
| 5 | + inherit (lib) flatten mapAttrs mapAttrsToList mkDefault mkEnableOption mkOption mkRemovedOptionModule mkRenamedOptionModule types; |
6 | 6 |
|
7 | 7 | cargoManifestPathArg = |
8 | 8 | lib.optionalString |
|
33 | 33 | (mkRemovedOptionModule [ "settings" "yamllint" "relaxed" ] '' |
34 | 34 | This option has been removed. Use `hooks.yamllint.settings.preset = "relaxed"`. |
35 | 35 | '') |
| 36 | + ( |
| 37 | + mkRemovedOptionModule |
| 38 | + [ "hooks" "latexindent" "settings" "flags" ] |
| 39 | + "Use hooks.latexindent.settings.extraConfig instead." |
| 40 | + ) |
36 | 41 | ] |
37 | 42 | # Manually rename options that had a package or a config option |
38 | 43 | ++ flatten (mapAttrsToList (name: map (o: mkRenamedOptionModule [ "settings" name o ] [ "hooks" name "settings" o ])) { |
|
631 | 636 | type = types.submodule { |
632 | 637 | imports = [ hookModule ]; |
633 | 638 | options.settings = { |
634 | | - flags = |
635 | | - mkOption { |
636 | | - type = types.str; |
637 | | - description = "Flags passed to latexindent. See available flags [here](https://latexindentpl.readthedocs.io/en/latest/sec-how-to-use.html#from-the-command-line)"; |
638 | | - default = "--local --silent --overwriteIfDifferent"; |
639 | | - }; |
| 639 | + extraConfig = mkOption { |
| 640 | + type = types.attrs; |
| 641 | + description = "[latexindent command-line options](https://latexindentpl.readthedocs.io/en/latest/sec-how-to-use.html#from-the-command-line) converted through `lib.cli.toGNUCommandLine`."; |
| 642 | + default = { }; |
| 643 | + |
| 644 | + example = lib.literalExpression '' |
| 645 | + { |
| 646 | + yaml = "defaultIndent: ' '"; |
| 647 | + } |
| 648 | + ''; |
| 649 | + }; |
640 | 650 | }; |
641 | 651 | }; |
642 | 652 | }; |
@@ -2768,7 +2778,17 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol |
2768 | 2778 | description = "Perl script to add indentation to LaTeX files."; |
2769 | 2779 | types = [ "file" "tex" ]; |
2770 | 2780 | package = tools.latexindent; |
2771 | | - entry = "${hooks.latexindent.package}/bin/latexindent ${hooks.latexindent.settings.flags}"; |
| 2781 | + |
| 2782 | + entry = "${hooks.latexindent.package}/bin/latexindent ${ |
| 2783 | + lib.cli.toGNUCommandLineShell {} ( |
| 2784 | + { |
| 2785 | + local = true; |
| 2786 | + overwriteIfDifferent = true; |
| 2787 | + silent = true; |
| 2788 | + } |
| 2789 | + // hooks.latexindent.settings.extraConfig |
| 2790 | + ) |
| 2791 | + }"; |
2772 | 2792 | }; |
2773 | 2793 | lacheck = |
2774 | 2794 | let |
|
0 commit comments