From c12bd0c7ca5ac4598b393558b9adb9302773e0be Mon Sep 17 00:00:00 2001 From: Richie Cahill Date: Sat, 8 Feb 2025 17:37:54 -0500 Subject: [PATCH] set up treefmt --- flake.nix | 2 +- treefmt.toml | 14 ++++++++++++++ users/richie/home/programs.nix | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 treefmt.toml diff --git a/flake.nix b/flake.nix index 584e60d..2b7e3c8 100644 --- a/flake.nix +++ b/flake.nix @@ -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 { diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..476bc72 --- /dev/null +++ b/treefmt.toml @@ -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"] diff --git a/users/richie/home/programs.nix b/users/richie/home/programs.nix index ac338b2..9e21dd8 100644 --- a/users/richie/home/programs.nix +++ b/users/richie/home/programs.nix @@ -50,7 +50,7 @@ nix-output-monitor nix-prefetch nix-tree - nixpkgs-fmt + nixfmt-rfc-style inputs.system_tools.packages.x86_64-linux.default ]; }