set up treefmt

This commit is contained in:
2025-02-08 17:37:54 -05:00
parent f43a34f37c
commit c12bd0c7ca
3 changed files with 16 additions and 2 deletions

View File

@@ -73,7 +73,7 @@
overlays = import ./overlays {inherit inputs outputs;};
devShells = forEachSystem (pkgs: import ./shell.nix {inherit pkgs;});
formatter = forEachSystem (pkgs: pkgs.alejandra);
formatter = forEachSystem (pkgs: pkgs.treefmt);
nixosConfigurations = {
bob = lib.nixosSystem {

14
treefmt.toml Normal file
View File

@@ -0,0 +1,14 @@
# One CLI to format the code tree - https://github.com/numtide/treefmt
[global]
# Glob patterns of files to exclude
excludes = [".git/"]
[formatter.nixfmt]
# Formatter to run
command = "nixfmt"
# Command-line arguments for the command
#options = []
# Glob pattern of files to include
includes = ["*.nix"]

View File

@@ -50,7 +50,7 @@
nix-output-monitor
nix-prefetch
nix-tree
nixpkgs-fmt
nixfmt-rfc-style
inputs.system_tools.packages.x86_64-linux.default
];
}