Skip to content

Commit

Permalink
ci: use the development shell from crane
Browse files Browse the repository at this point in the history
A recent crane update [1] added a wrapper for pkgs.mkShell. Another pull
request [2] also automatically adds rustfmt and clippy to the dev shell.

This commit uses the new crane development shell to simplify the setup.

Links:
  [1] ipetkov/crane#378
  [2] ipetkov/crane#432
  • Loading branch information
tfkhim committed Oct 29, 2023
1 parent 50b0ed2 commit a1857d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 88 deletions.
85 changes: 4 additions & 81 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
sway-workspace-extras = self.packages.${prev.system}.default;
};

devShells = forSupportedSystems ({ system, pkgs, ... }:
devShells = forSupportedSystems ({ system, pkgs, craneLib, ... }:
let
fix = pkgs.writeShellScriptBin "fix" ''
cargo fmt
Expand All @@ -72,14 +72,10 @@
'';
in
{
default = pkgs.mkShell {
default = craneLib.devShell {
inputsFrom = [ self.packages.${system}.package ];

nativeBuildInputs = with pkgs; [
cargo
rustc
clippy
rustfmt
packages = [
fix
checkFmt
lint
Expand Down

0 comments on commit a1857d0

Please sign in to comment.