From db9da2b1f7840c6caca304d7999ef4833a1b1a17 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Mon, 19 Feb 2024 00:11:19 -0800 Subject: [PATCH] Use mkDefault for default formatters This enables easier overriding of formatting defaults. --- builtinModules/builtinFormatters.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/builtinModules/builtinFormatters.nix b/builtinModules/builtinFormatters.nix index bcac6b7..33fec29 100644 --- a/builtinModules/builtinFormatters.nix +++ b/builtinModules/builtinFormatters.nix @@ -4,7 +4,7 @@ { config, lib, ... }: let - inherit (lib) mkEnableOption mkIf; + inherit (lib) mkDefault mkEnableOption mkIf; in { options.flakelight.builtinFormatters = @@ -23,11 +23,11 @@ in prettier = "${pkgs.nodePackages.prettier}/bin/prettier --write"; in { - "*.nix" = nixpkgs-fmt; - "*.md" = prettier; - "*.json" = prettier; - "*.yaml" = prettier; - "*.yml" = prettier; + "*.nix" = mkDefault nixpkgs-fmt; + "*.md" = mkDefault prettier; + "*.json" = mkDefault prettier; + "*.yaml" = mkDefault prettier; + "*.yml" = mkDefault prettier; }; }; }