build: add prettier with jinja plugin to treefmt
This commit is contained in:
parent
31dc620b0a
commit
8d433d8e99
1 changed files with 12 additions and 0 deletions
12
flake.nix
12
flake.nix
|
|
@ -49,6 +49,11 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
prettierWithJinja = pkgs.writeShellScriptBin "prettier" ''
|
||||||
|
export NODE_PATH="${pkgs.prettier}/lib/node_modules"
|
||||||
|
exec ${pkgs.prettier}/bin/prettier "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
cargoToml = lib.trivial.importTOML ./Cargo.toml;
|
cargoToml = lib.trivial.importTOML ./Cargo.toml;
|
||||||
version = cargoToml.package.version;
|
version = cargoToml.package.version;
|
||||||
in
|
in
|
||||||
|
|
@ -151,6 +156,13 @@
|
||||||
programs = {
|
programs = {
|
||||||
deadnix.enable = true;
|
deadnix.enable = true;
|
||||||
nixfmt.enable = true;
|
nixfmt.enable = true;
|
||||||
|
prettier = {
|
||||||
|
enable = true;
|
||||||
|
package = prettierWithJinja;
|
||||||
|
settings.plugins = [
|
||||||
|
"${pkgs.prettier-plugin-jinja-template}/lib/node_modules/prettier-plugin-jinja-template/lib/index.js"
|
||||||
|
];
|
||||||
|
};
|
||||||
rustfmt.enable = true;
|
rustfmt.enable = true;
|
||||||
shfmt.enable = true;
|
shfmt.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue