forked from rust-lang/rustlings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
45 lines (43 loc) · 1.21 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
inputs = {
nixpkgs-mozilla = { url = github:mozilla/nixpkgs-mozilla; flake = false; };
cargo2nix.url = github:onsails/cargo2nix/flake;
utils.url = github:numtide/flake-utils;
};
outputs = { nixpkgs, utils, cargo2nix, nixpkgs-mozilla, ... }: utils.lib.eachDefaultSystem (system:
let
rustChannel = "1.49.0";
rustChannelSha256 = "KCh2UBGtdlBJ/4UOqZlxUtcyefv7MH1neoVNV4z0nWs=";
pkgs = import nixpkgs {
inherit system;
overlays = [
(import "${nixpkgs-mozilla}/rust-overlay.nix")
cargo2nix.overlay
(
self: super: {
rustStable = (
super.rustChannelOf {
channel = rustChannel;
sha256 = rustChannelSha256;
}
).rust;
}
)
];
};
rustPkgs = pkgs.rustBuilder.makePackageSet' {
inherit rustChannel rustChannelSha256;
packageFun = import ./Cargo.nix;
};
in
{
defaultPackage = rustPkgs.workspace.rustlings { };
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
(rustPkgs.workspace.rustlings {})
rustStable
];
};
}
);
}