Closed atcol closed 3 years ago
Hey! From just looking at it a little, I believe
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
nixpkgs.overlays = [ rust-overlay.overlay ];
devShell = pkgs.mkShell {
You are using the overlay to modify nixpkgs after you already took pkgs from it, so I think it isn't evaluated.
nixpkgs.overlays = [ rust-overlay.overlay ];
From a personal project that is a little bit different, maybe you can adjust it:
utils.lib.eachDefaultSystem (system: let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
That worked! Thanks so much. I knew the nixpkgs.overlays
felt wrong but I didn't know the syntax to move things around correctly.
Here's a working example:
{
description = "Blah";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
devShell = import ./shell.nix { inherit pkgs; };
}
);
}
Hello. I'm new-ish to Nix and learning flakes. I am attempting to set up my Rust development environment but I'm struggling to get the rust overlay working with a Flake and this repo.
Do you have a
devShell
example available?I'm trying as follows:
This fails with: