nix: move ci dependencies to the devShell (#161)

Fixes #160
This commit is contained in:
Tristan de Cacqueray 2022-05-12 09:42:14 +00:00 committed by GitHub
parent 0236d1fdc9
commit be1d854f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,8 +17,23 @@ let
src = nixpkgs.lib.cleanSource ./.;
# Those are being used in tests
nativeBuildInputs = with nixpkgs; [
buildInputs = with nixpkgs; lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security libiconv ];
doCheck = true;
cargoLock.lockFile = ./Cargo.lock;
meta.description = "one CLI to format the code tree";
};
# Add all the dependencies of treefmt, plus more build tools
devShell = treefmt.overrideAttrs (prev: {
shellHook = ''
# Put the treefmt binary on the PATH when it's built
export PATH=$PWD/target/debug:$PATH
'';
nativeBuildInputs = prev.nativeBuildInputs ++ (with nixpkgs; [
# Build tools
rustPackages.clippy
rust-analyzer
@ -39,29 +54,15 @@ let
terraform
mdbook
];
shellHook = ''
# Put the treefmt binary on the PATH when it's built
export PATH=$PWD/target/debug:$PATH
'';
buildInputs = with nixpkgs; lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security libiconv ];
doCheck = true;
cargoLock.lockFile = ./Cargo.lock;
meta.description = "one CLI to format the code tree";
};
]);
});
in
{
inherit treefmt;
inherit treefmt devShell;
# A collection of packages for the project
docs = nixpkgs.callPackage ./docs { };
# Flake attributes
defaultPackage = treefmt;
devShell = treefmt;
}