mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
Set patched alejandra to be the flakes default formatter
This commit is contained in:
parent
9541e99a78
commit
cb9463a57b
2 changed files with 12 additions and 15 deletions
11
flake.nix
11
flake.nix
|
|
@ -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 {
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
packages = [pkgs.sops];
|
packages = [pkgs.sops];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,7 @@
|
||||||
options.myConfig.vscode.enable = lib.mkEnableOption "";
|
options.myConfig.vscode.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.vscode.enable {
|
config = lib.mkIf config.myConfig.vscode.enable {
|
||||||
home.packages = let
|
home.packages = [pkgs.nil];
|
||||||
alejandra4 = pkgs.alejandra.overrideAttrs {
|
|
||||||
passthru.tests.version = lib.mkForce {};
|
|
||||||
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
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in [
|
|
||||||
pkgs.nil
|
|
||||||
alejandra4
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue