From d4aa5ceed0e191e216c76aaf51239749448dac6a Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Thu, 11 Dec 2025 17:03:44 +0100 Subject: [PATCH] Specify --tree-root to treefmt flake check Since the .git directory is filtered out of the the src files in the sandboxed build, treefmt incorrectly identifies /nix/store as the project root and attempts to format readonly files there Specifying `--tree-root .` (will be `/build/source` in the sandbox container) ensures that only the project files are formatted as expected. --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 077b90537..c85e5e588 100644 --- a/flake.nix +++ b/flake.nix @@ -210,7 +210,7 @@ src = pkgs.lib.sources.sourceFilesBySuffices ./. [ ".nix" ]; nativeBuildInputs = [ pkgs.nixfmt-tree ]; checkPhase = '' - treefmt --ci + treefmt --ci --tree-root . ''; };