From f3866482e7f1aefe931066a6e24fb6397014ff38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linnea=20Gr=C3=A4f?= Date: Fri, 15 May 2026 21:54:59 +0200 Subject: [PATCH] ci: fix formatting check erroring out in an incorrect manner previously this would fail with a non descript openTempFileWithDefaultPermissions: permission denied (Permission denied) now the correct file gets identified in the error log --- checks/formatting.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/checks/formatting.nix b/checks/formatting.nix index b399c670..cdfb2bf2 100644 --- a/checks/formatting.nix +++ b/checks/formatting.nix @@ -4,8 +4,11 @@ }: pkgs.runCommand "formatting-check" { } '' - ${ - pkgs.lib.getExe self.formatter.${pkgs.stdenv.hostPlatform.system} - } --no-cache --fail-on-change ${../.} + cp -r ${../.}/ src + # will be copied readonly from the /nix/store + # nixfmt sadly ignores --fail-on-change and still tries to write to the file + # ergo, we create our own writable copy + chmod -R +w src + ${pkgs.lib.getExe self.formatter.${pkgs.stdenv.hostPlatform.system}} --ci --tree-root ./src ./src touch $out ''