use treefmt-nix
2 files changed, 41 insertions(+), 1 deletion(-)
changed files
M flake.lock → flake.lock
@@ -575,6 +575,22 @@ "repo": "nixpkgs", "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1747958103, + "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "flake-parts": "flake-parts_2",@@ -735,6 +751,7 @@ "nixvim": "nixvim", "nur": "nur", "searchix": "searchix", "srvos": "srvos", + "treefmt-nix": "treefmt-nix_3", "utils": "utils" } },@@ -944,6 +961,24 @@ "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", "owner": "numtide", "repo": "treefmt-nix", "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_3": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1750931469, + "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", "type": "github" }, "original": {
M flake.nix → flake.nix
@@ -25,6 +25,7 @@ nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; + treefmt-nix.url = "github:numtide/treefmt-nix"; golink = { url = "github:tailscale/golink"; inputs.nixpkgs.follows = "nixpkgs";@@ -183,6 +184,10 @@ // utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; }; + treefmtEval = treefmt-nix.lib.evalModule pkgs { + projectRootFile = "flake.nix"; + programs.nixfmt.enable = true; + }; in { devShells = {@@ -193,7 +198,7 @@ agenix.packages.${system}.default ]; }; }; - formatter = pkgs.nixfmt-tree; + formatter = treefmtEval.config.build.wrapper; } ); }