Use mkDefault for default formatters

This enables easier overriding of formatting defaults.
This commit is contained in:
Archit Gupta 2024-02-19 00:11:19 -08:00
parent 40af04adb6
commit db9da2b1f7

View File

@ -4,7 +4,7 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkDefault mkEnableOption mkIf;
in in
{ {
options.flakelight.builtinFormatters = options.flakelight.builtinFormatters =
@ -23,11 +23,11 @@ in
prettier = "${pkgs.nodePackages.prettier}/bin/prettier --write"; prettier = "${pkgs.nodePackages.prettier}/bin/prettier --write";
in in
{ {
"*.nix" = nixpkgs-fmt; "*.nix" = mkDefault nixpkgs-fmt;
"*.md" = prettier; "*.md" = mkDefault prettier;
"*.json" = prettier; "*.json" = mkDefault prettier;
"*.yaml" = prettier; "*.yaml" = mkDefault prettier;
"*.yml" = prettier; "*.yml" = mkDefault prettier;
}; };
}; };
} }