Skip to content

Commit

Permalink
build(#6): Add treefmt
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Dec 7, 2023
1 parent ddab000 commit 0c427c9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
37 changes: 36 additions & 1 deletion flake.lock

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

15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
nix2container.url = "github:nlewo/nix2container";
nix2container.inputs.nixpkgs.follows = "nixpkgs";
mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin";
treefmt-nix.url = "github:numtide/treefmt-nix";
};

nixConfig = {
Expand All @@ -18,6 +19,7 @@
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.devenv.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = ["x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];

Expand Down Expand Up @@ -62,6 +64,19 @@
LD_LIBRARY_PATH = "${pkgs.lib.getLib pkgs.gtest}/lib";
};
};

treefmt.config = {
projectRootFile = "flake.nix";

programs.alejandra.enable = true;
programs.clang-format.enable = true;
programs.deadnix.enable = true;
programs.prettier.enable = true;
programs.prettier.settings = {
editorconfig = true;
embeddedLanguageFormatting = "auto";
};
};
};
flake = {
# The usual flake attributes can be defined here, including system-
Expand Down

0 comments on commit 0c427c9

Please sign in to comment.