1
1
forked from extern/flakelight
flakelight/builtinModules/builtinFormatters.nix
Archit Gupta 592cb247bf Clarify use of formatter option
The fact it uses bash is an implementation detail. Update the
documentation to state that the input is a file name glob rather than a
bash case match. Updates the default formatters to not rely on being a
bash case statement.
2023-09-16 20:59:54 -07:00

27 lines
586 B
Nix

# flakelight -- Framework for simplifying flake setup
# Copyright (C) 2023 Archit Gupta <archit@accelbread.com>
# SPDX-License-Identifier: MIT
{ lib, ... }:
let
inherit (lib) mkEnableOption;
in
{
options.flakelight.builtinFormatters =
mkEnableOption "default formatters" // { default = true; };
config = {
devShell.packages = pkgs: [
pkgs.nixpkgs-fmt
pkgs.nodePackages.prettier
];
formatters = {
"*.nix" = "nixpkgs-fmt";
"*.md" = "prettier --write";
"*.json" = "prettier --write";
"*.yml" = "prettier --write";
};
};
}