Skip to content

Commit 8353890

Browse files
committed
Fix and simplify flake.nix
1 parent 298380a commit 8353890

File tree

2 files changed

+79
-105
lines changed

2 files changed

+79
-105
lines changed

flake.lock

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

flake.nix

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,27 @@
11
{
2-
description = "Nll crate";
2+
description = "A devShell example";
33

4-
nixConfig = {
5-
extra-substituters = [ "https://espresso-systems-private.cachix.org" ];
6-
extra-trusted-public-keys = [
7-
"espresso-systems-private.cachix.org-1:LHYk03zKQCeZ4dvg3NctyCq88e44oBZVug5LpYKjPRI="
8-
];
9-
};
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
6+
inputs.flake-utils.url = "github:numtide/flake-utils";
107

11-
inputs = {
12-
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
13-
utils.url = "github:numtide/flake-utils";
14-
flake-compat = {
15-
url = "github:edolstra/flake-compat";
16-
flake = false;
17-
};
18-
fenix = {
19-
url = "github:nix-community/fenix";
20-
inputs.nixpkgs.follows = "nixpkgs";
21-
};
22-
};
23-
24-
outputs =
25-
{ self, nixpkgs, flake-compat, utils, fenix }:
26-
utils.lib.eachDefaultSystem (system:
8+
outputs = { nixpkgs, rust-overlay, flake-utils, ... }:
9+
flake-utils.lib.eachDefaultSystem (system:
2710
let
28-
fenixStable = fenix.packages.${system}.stable.withComponents [
29-
"cargo"
30-
"clippy"
31-
"rust-src"
32-
"rustc"
33-
"rustfmt"
34-
"llvm-tools-preview"
35-
];
36-
37-
CARGO_TARGET_DIR = "target_dirs/nix_rustc";
38-
39-
rustOverlay = final: prev: {
40-
rustc = fenixStable;
41-
cargo = fenixStable;
42-
rust-src = fenixStable;
43-
};
44-
11+
overlays = [ (import rust-overlay) ];
4512
pkgs = import nixpkgs {
46-
inherit system;
47-
overlays = [ rustOverlay ];
13+
inherit system overlays;
4814
};
49-
50-
buildDeps = with pkgs;
51-
[
52-
nixpkgs-fmt
53-
fenix.packages.${system}.rust-analyzer
54-
] ++ lib.optionals stdenv.isDarwin [
55-
darwin.apple_sdk.frameworks.Security
56-
pkgs.libiconv
57-
darwin.apple_sdk.frameworks.SystemConfiguration
15+
in
16+
with pkgs;
17+
{
18+
CARGO_TARGET_DIR = "target_dirs/nix_rustc";
19+
devShells.default = mkShell {
20+
buildInputs = [
21+
just
22+
rust-bin.stable.latest.default
5823
];
59-
in {
60-
devShell = pkgs.mkShell {
61-
inherit CARGO_TARGET_DIR;
62-
buildInputs = [ fenixStable ] ++ buildDeps;
6324
};
64-
65-
});
25+
}
26+
);
6627
}

0 commit comments

Comments
 (0)