Set patched alejandra to be the flakes default formatter

This commit is contained in:
SebastianStork 2024-03-23 20:37:24 +01:00
parent 9541e99a78
commit cb9463a57b
2 changed files with 12 additions and 15 deletions

View file

@ -46,6 +46,17 @@
};
};
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra.overrideAttrs {
passthru.tests.version = {};
postPatch = ''
substituteInPlace src/alejandra/src/builder.rs \
--replace '2 * build_ctx.indentation' '4 * build_ctx.indentation'
substituteInPlace src/alejandra/src/rules/string.rs \
--replace 'format!(" {}", line)' 'format!(" {}", line)'
rm -r src/alejandra/tests
'';
};
devShells.${system}.default = pkgs.mkShell {
packages = [pkgs.sops];
};