Skip to content

Commit 7577fe8

Browse files
atar13Samir-Rashid
authored andcommitted
move devshell to fenix
1 parent 6273c5b commit 7577fe8

2 files changed

Lines changed: 114 additions & 22 deletions

File tree

flake.lock

Lines changed: 79 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
{
2-
description = "A very basic flake";
2+
description = "binary-room";
33

44
inputs = {
5-
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
5+
nixpkgs.url = "nixpkgs/nixos-unstable";
6+
fenix = {
7+
url = "github:nix-community/fenix";
8+
inputs.nixpkgs.follows = "nixpkgs";
9+
};
10+
flake-utils.url = "github:numtide/flake-utils";
611
};
712

813

9-
outputs = { self, nixpkgs }: let
10-
pkgs = import nixpkgs {
11-
system = "x86_64-linux";
12-
};
13-
in {
14-
devShells.x86_64-linux.default = pkgs.mkShell {
15-
# Use the same mkShell as documented above
16-
packages = with pkgs; [
17-
# TODO: @Anthony, you can change this to use Fenix if you would like
18-
rustup
19-
];
20-
};
21-
};
14+
outputs = { self, nixpkgs, fenix, flake-utils }:
15+
flake-utils.lib.eachDefaultSystem
16+
(system:
17+
let
18+
pkgs = import nixpkgs {
19+
inherit system;
20+
overlays = [ fenix.overlays.default ];
21+
};
22+
rustToolchain = fenix.packages."${system}".stable;
23+
in
24+
{
25+
devShells.default = pkgs.mkShell {
26+
nativeBuildInputs = [
27+
(rustToolchain.withComponents
28+
[
29+
"cargo"
30+
"clippy"
31+
"rust-src"
32+
"rustc"
33+
"rustfmt"
34+
])
35+
];
36+
packages = with pkgs; [
37+
rust-analyzer-nightly
38+
];
39+
};
40+
}
41+
);
2242
}

0 commit comments

Comments
 (0)