mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
feat: keep funcs implementations on same line
This commit is contained in:
parent
23329ebca0
commit
47936c83fe
7 changed files with 207 additions and 158 deletions
99
flake.nix
99
flake.nix
|
@ -4,61 +4,68 @@
|
|||
fenix.url = "github:nix-community/fenix";
|
||||
fenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
fenix.inputs.rust-analyzer-src.follows = "rustAnalyzer";
|
||||
|
||||
flakeCompat.url = github:edolstra/flake-compat;
|
||||
flakeCompat.flake = false;
|
||||
|
||||
flakeUtils.url = "github:numtide/flake-utils";
|
||||
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
rustAnalyzer.url = "github:rust-analyzer/rust-analyzer";
|
||||
rustAnalyzer.flake = false;
|
||||
|
||||
treefmt.url = "github:numtide/treefmt";
|
||||
treefmt.inputs.flake-utils.follows = "flakeUtils";
|
||||
treefmt.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs = inputs: inputs.flakeUtils.lib.eachSystem [ "x86_64-darwin" "x86_64-linux" ] (
|
||||
system: let
|
||||
nixpkgs = import inputs.nixpkgs { inherit system; };
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
treefmt = inputs.treefmt.defaultPackage.${system};
|
||||
fenix = inputs.fenix.packages.${system};
|
||||
fenixPlatform = nixpkgs.makeRustPlatform { inherit (fenix.latest) cargo rustc; };
|
||||
in
|
||||
{
|
||||
checks.defaultPackage = inputs.self.defaultPackage.${system};
|
||||
defaultApp = {
|
||||
type = "app";
|
||||
program = "${inputs.self.defaultPackage.${system}}/bin/alejandra";
|
||||
};
|
||||
defaultPackage = fenixPlatform.buildRustPackage {
|
||||
pname = cargoToml.package.name;
|
||||
version =
|
||||
let
|
||||
commit = inputs.self.shortRev or "dirty";
|
||||
date = inputs.self.lastModifiedDate or inputs.self.lastModified or "19700101";
|
||||
in
|
||||
"${builtins.substring 0 8 date}_${commit}";
|
||||
src = inputs.self.sourceInfo;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
meta = {
|
||||
description = cargoToml.package.description;
|
||||
homepage = "https://github.com/kamadorueda/alejandra";
|
||||
license = nixpkgs.lib.licenses.unlicense;
|
||||
maintainers = [ nixpkgs.lib.maintainers.kamadorueda ];
|
||||
outputs = inputs:
|
||||
inputs.flakeUtils.lib.eachSystem [ "x86_64-darwin" "x86_64-linux" ] (
|
||||
system: let
|
||||
nixpkgs = import inputs.nixpkgs { inherit system; };
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
treefmt = inputs.treefmt.defaultPackage.${system};
|
||||
fenix = inputs.fenix.packages.${system};
|
||||
fenixPlatform = nixpkgs.makeRustPlatform { inherit (fenix.latest) cargo rustc; };
|
||||
in
|
||||
{
|
||||
checks.defaultPackage = inputs.self.defaultPackage.${system};
|
||||
defaultApp = {
|
||||
type = "app";
|
||||
program = "${inputs.self.defaultPackage.${system}}/bin/alejandra";
|
||||
};
|
||||
};
|
||||
devShell = nixpkgs.mkShell {
|
||||
name = "Alejandra";
|
||||
packages = [
|
||||
fenix.rust-analyzer
|
||||
fenix.latest.toolchain
|
||||
nixpkgs.cargo-tarpaulin
|
||||
nixpkgs.jq
|
||||
nixpkgs.nodejs
|
||||
nixpkgs.nodePackages.prettier
|
||||
nixpkgs.nodePackages.prettier-plugin-toml
|
||||
nixpkgs.shfmt
|
||||
treefmt
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
defaultPackage = fenixPlatform.buildRustPackage {
|
||||
pname = cargoToml.package.name;
|
||||
version =
|
||||
let
|
||||
commit = inputs.self.shortRev or "dirty";
|
||||
date =
|
||||
inputs.self.lastModifiedDate or inputs.self.lastModified or "19700101";
|
||||
in
|
||||
"${builtins.substring 0 8 date}_${commit}";
|
||||
src = inputs.self.sourceInfo;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
meta = {
|
||||
description = cargoToml.package.description;
|
||||
homepage = "https://github.com/kamadorueda/alejandra";
|
||||
license = nixpkgs.lib.licenses.unlicense;
|
||||
maintainers = [ nixpkgs.lib.maintainers.kamadorueda ];
|
||||
};
|
||||
};
|
||||
devShell = nixpkgs.mkShell {
|
||||
name = "Alejandra";
|
||||
packages = [
|
||||
fenix.rust-analyzer
|
||||
fenix.latest.toolchain
|
||||
nixpkgs.cargo-tarpaulin
|
||||
nixpkgs.jq
|
||||
nixpkgs.nodejs
|
||||
nixpkgs.nodePackages.prettier
|
||||
nixpkgs.nodePackages.prettier-plugin-toml
|
||||
nixpkgs.shfmt
|
||||
treefmt
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue