Skip to content

Commit

Permalink
simplify fenix integration in flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
wucke13 committed Jul 28, 2023
1 parent 3988a41 commit 17781d6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, utils, fenix, naersk, devshell, ... }@inputs:
outputs = { self, nixpkgs, utils, naersk, devshell, ... }@inputs:
utils.lib.eachSystem [ "x86_64-linux" "i686-linux" "aarch64-linux" ] (system:
let
lib = nixpkgs.lib;
Expand All @@ -29,7 +29,10 @@
# converts a string to SHOUT_CASE
shout = string: builtins.replaceStrings [ "-" ] [ "_" ] (nixpkgs.lib.toUpper string);

rust-toolchain = with fenix.packages.${system};
# Rust distribution for our hostSystem
fenix = inputs.fenix.packages.${system};

rust-toolchain = with fenix;
combine [
latest.rustc
latest.cargo
Expand Down Expand Up @@ -132,7 +135,7 @@
{
name = "udeps";
command = ''
PATH="${fenix.packages.${system}.latest.rustc}/bin:$PATH"
PATH="${fenix.latest.rustc}/bin:$PATH"
cargo udeps $@
'';
help = pkgs.cargo-udeps.meta.description;
Expand All @@ -150,7 +153,7 @@
{
name = "expand";
command = ''
PATH="${fenix.packages.${system}.latest.rustc}/bin:$PATH"
PATH="${fenix.latest.rustc}/bin:$PATH"
cargo expand $@
'';
help = pkgs.cargo-expand.meta.description;
Expand Down

0 comments on commit 17781d6

Please sign in to comment.