Merge pull request 'add cargo to dev shell' (#39) from nix-update-dev-shell into main
Reviewed-on: #39
This commit is contained in:
commit
4a1eb8d3f9
1 changed files with 54 additions and 43 deletions
97
flake.nix
97
flake.nix
|
@ -24,58 +24,69 @@
|
|||
packages = with pkgs; [
|
||||
corepack_latest
|
||||
nodejs
|
||||
cargo
|
||||
clippy
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
packages = forSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = pkgs' system;
|
||||
in
|
||||
{
|
||||
fmt = pkgs.treefmt.withConfig {
|
||||
runtimeInputs = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
nodePackages.prettier
|
||||
rustfmt
|
||||
];
|
||||
settings = {
|
||||
tree-root-file = ".git/index";
|
||||
formatter = {
|
||||
nixfmt = {
|
||||
command = "nixfmt";
|
||||
includes = [ "*.nix" ];
|
||||
};
|
||||
rustfmt = {
|
||||
command = "rustfmt";
|
||||
options = [
|
||||
"--edition"
|
||||
"2018"
|
||||
];
|
||||
includes = [ "*.rs" ];
|
||||
};
|
||||
prettier = {
|
||||
command = "prettier";
|
||||
options = [ "--write" ];
|
||||
excludes = [ "pnpm-lock.yaml" ];
|
||||
includes = [
|
||||
"*.css"
|
||||
"*.html"
|
||||
"*.js"
|
||||
"*.json"
|
||||
"*.jsx"
|
||||
"*.md"
|
||||
"*.mdx"
|
||||
"*.scss"
|
||||
"*.ts"
|
||||
"*.yaml"
|
||||
"*.yml"
|
||||
"*.vue"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
formatter = forSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = pkgs' system;
|
||||
in
|
||||
pkgs.treefmt.withConfig {
|
||||
runtimeInputs = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
nodePackages.prettier
|
||||
rustfmt
|
||||
];
|
||||
settings = {
|
||||
tree-root-file = ".git/index";
|
||||
formatter = {
|
||||
nixfmt = {
|
||||
command = "nixfmt";
|
||||
includes = [ "*.nix" ];
|
||||
};
|
||||
rustfmt = {
|
||||
command = "rustfmt";
|
||||
options = [
|
||||
"--edition"
|
||||
"2018"
|
||||
];
|
||||
includes = [ "*.rs" ];
|
||||
};
|
||||
prettier = {
|
||||
command = "prettier";
|
||||
options = [ "--write" ];
|
||||
excludes = [ "pnpm-lock.yaml" ];
|
||||
includes = [
|
||||
"*.css"
|
||||
"*.html"
|
||||
"*.js"
|
||||
"*.json"
|
||||
"*.jsx"
|
||||
"*.md"
|
||||
"*.mdx"
|
||||
"*.scss"
|
||||
"*.ts"
|
||||
"*.yaml"
|
||||
"*.yml"
|
||||
"*.vue"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
self.outputs.packages.${system}.fmt
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue