Skip to content

Commit

Permalink
chore(nix): install treefmt-nix (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhess authored Apr 5, 2024
2 parents 0f23577 + 952bd7d commit e16b33b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
.github/
23 changes: 22 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
nixos-generators.url = github:nix-community/nixos-generators;
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";

treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";

pre-commit-hooks-nix.url = github:cachix/pre-commit-hooks.nix;
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";

Expand All @@ -29,6 +32,7 @@

imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = [ "x86_64-linux" "aarch64-darwin" ];

Expand All @@ -53,11 +57,11 @@
settings = {
src = ./.;
hooks = {
treefmt.enable = true;
nixpkgs-fmt.enable = true;

prettier = {
enable = true;
excludes = [ ".github/" ];
};

actionlint = {
Expand Down Expand Up @@ -119,6 +123,14 @@
)
);

treefmt.config = {
projectRootFile = "flake.nix";
programs = {
prettier.enable = true;
nixpkgs-fmt.enable = true;
};
};

apps =
let
mkApp = pkg: script: {
Expand All @@ -134,6 +146,10 @@
});

devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];

buildInputs = (with pkgs;
[
actionlint
Expand Down

0 comments on commit e16b33b

Please sign in to comment.