1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-31 04:27:45 +00:00

fix: devshell cargo version

fixes: #4
This commit is contained in:
David Arnold 2022-01-29 19:16:43 -05:00
parent 870af566c7
commit 0838e5a2b5
No known key found for this signature in database
GPG key ID: 0318D822BAC965CC
2 changed files with 62 additions and 12 deletions

View file

@ -3,7 +3,9 @@
flakeCompat.url = github:edolstra/flake-compat;
flakeCompat.flake = false;
flakeUtils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.follows = "fenix/nixpkgs";
# add https://app.cachix.org/cache/nix-community to your `nix.conf`
fenix.url = "github:nix-community/fenix";
};
outputs =
inputs:
@ -11,6 +13,7 @@
(
system:
let
toolchain = "stable";
nixpkgs = import inputs.nixpkgs { inherit system; };
cargoToml = builtins.fromTOML ( builtins.readFile ./Cargo.toml );
in
@ -21,7 +24,9 @@
};
defaultApp = { type = "app"; program = "${ inputs.self.defaultPackage.${ system } }/bin/alejandra"; };
defaultPackage =
nixpkgs.rustPlatform.buildRustPackage
(nixpkgs.makeRustPlatform {
inherit (inputs.fenix.packages.${ system }.${ toolchain }) cargo rustc;
}).buildRustPackage
{
pname = cargoToml.package.name;
version =
@ -43,11 +48,16 @@
devShell =
nixpkgs.mkShell
{
packages = [ nixpkgs.cargo-tarpaulin nixpkgs.rustup ];
shellHook =
''
rustup toolchain install nightly
'';
packages = [
inputs.fenix.packages.${ system }.rust-analyzer
(inputs.fenix.packages.${ system }.${ toolchain }.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
];
};
packages = {
nixpkgsFormatted =