diff options
author | tzlil <tzlils@protonmail.com> | 2023-03-21 17:00:25 +0200 |
---|---|---|
committer | tzlil <tzlils@protonmail.com> | 2023-03-21 17:00:25 +0200 |
commit | 651c189659a082eaca2a945232c934dd822735c9 (patch) | |
tree | 1a71481eb8d6c36a947b7e9bf42053c3d9931e3f /flake.nix | |
parent | 6a4885f8e0ac840fff26ee99fd6bd8bfa2edaae9 (diff) |
add fenix to flake, change to nightly
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 12 |
1 files changed, 10 insertions, 2 deletions
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; |