-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cef1dec
commit c271d18
Showing
4 changed files
with
296 additions
and
296 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ inputs, ... }: | ||
{ | ||
imports = [ | ||
inputs.treefmt-nix.flakeModule | ||
]; | ||
perSystem = | ||
{ config, pkgs, ... }: | ||
{ | ||
# Auto formatters. This also adds a flake check to ensure that the | ||
# source tree was auto formatted. | ||
treefmt.config = { | ||
flakeFormatter = true; | ||
flakeCheck = true; | ||
projectRootFile = "flake.nix"; | ||
|
||
# we really need to mirror the treefmt.toml as we can't use it directly | ||
global.excludes = [ | ||
"*.gitignore" | ||
"*.dockerignore" | ||
".envrc" | ||
"*.node-version" | ||
"Dockerfile" | ||
"grafana/Dockerfile" | ||
"Makefile" | ||
"VERSION" | ||
"LICENSE" | ||
"*.metadata" | ||
"*.manifest" | ||
"*.webmanifest" | ||
"*.dat" | ||
"*.lock" | ||
"*.txt" | ||
"*.csv" | ||
"*.ico" | ||
"*.png" | ||
"*.svg" | ||
"*.properties" | ||
"*.xml" | ||
"*.po" | ||
"*.pot" | ||
"*.json.example" | ||
"*.typos.toml" | ||
"treefmt.toml" | ||
"grafana/dashboards/*.json" # we use the grafana export style | ||
]; | ||
programs.mix.enable = true; | ||
settings.formatter.mix-format.includes = [ | ||
"*.ex" | ||
"*.exs" | ||
"*.{heex,eex}" | ||
]; | ||
# run shellcheck first | ||
programs.shellcheck.enable = true; | ||
settings.formatter.shellcheck.priority = 0; # default is 0, but we set it here for clarity | ||
|
||
# shfmt second | ||
programs.shfmt.enable = true; | ||
settings.formatter.shfmt.priority = 1; | ||
|
||
programs.prettier.enable = true; | ||
|
||
programs.nixpkgs-fmt.enable = true; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.