From 651c189659a082eaca2a945232c934dd822735c9 Mon Sep 17 00:00:00 2001 From: tzlil Date: Tue, 21 Mar 2023 17:00:25 +0200 Subject: add fenix to flake, change to nightly --- flake.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index b8230de..56146ab 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; treefmt-nix.url = "github:numtide/treefmt-nix"; }; @@ -10,14 +14,18 @@ systems = [ "x86_64-linux" ]; imports = [ inputs.treefmt-nix.flakeModule ]; - perSystem = { pkgs, lib, config, ... }: + perSystem = { pkgs, lib, config, system, ... }: let + toolchain = inputs.fenix.packages.${system}.minimal.toolchain; src = lib.sourceFilesBySuffices inputs.self [ ".rs" ".toml" "Cargo.lock" ]; inherit (lib.importTOML (src + "/Cargo.toml")) package; in { packages = { - ${package.name} = pkgs.rustPlatform.buildRustPackage { + ${package.name} = (pkgs.makeRustPlatform { + cargo = toolchain; + rustc = toolchain; + }).buildRustPackage { pname = package.name; inherit (package) version; inherit src; -- cgit 1.4.1