mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 04:27:45 +00:00
feat: update inputs and format
This commit is contained in:
parent
969023c1d6
commit
4a45bf1de4
3 changed files with 51 additions and 51 deletions
94
flake.nix
94
flake.nix
|
@ -29,56 +29,56 @@
|
|||
system:
|
||||
let
|
||||
nixpkgs = import inputs.nixpkgs { inherit system; };
|
||||
cargoToml = builtins.fromTOML ( builtins.readFile ./Cargo.toml );
|
||||
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; };
|
||||
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 ];
|
||||
{
|
||||
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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
devShell =
|
||||
nixpkgs.mkShell
|
||||
{
|
||||
name = "Alejandra";
|
||||
packages = [
|
||||
fenix.rust-analyzer
|
||||
fenix.latest.cargo
|
||||
fenix.latest.clippy
|
||||
fenix.latest.rust-src
|
||||
fenix.latest.rustc
|
||||
fenix.latest.rustfmt
|
||||
inputs.alejandra.outputs.defaultPackage.${ system }
|
||||
nixpkgs.jq
|
||||
nixpkgs.nodejs
|
||||
nixpkgs.nodePackages.prettier
|
||||
nixpkgs.nodePackages.prettier-plugin-toml
|
||||
nixpkgs.shfmt
|
||||
treefmt
|
||||
];
|
||||
};
|
||||
}
|
||||
devShell =
|
||||
nixpkgs.mkShell
|
||||
{
|
||||
name = "Alejandra";
|
||||
packages = [
|
||||
fenix.rust-analyzer
|
||||
fenix.latest.cargo
|
||||
fenix.latest.clippy
|
||||
fenix.latest.rust-src
|
||||
fenix.latest.rustc
|
||||
fenix.latest.rustfmt
|
||||
inputs.alejandra.outputs.defaultPackage.${ system }
|
||||
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