From 70eeba1f481d625db311ea4d961453d3e1b90ea7 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 22 Aug 2020 21:16:26 +0530 Subject: init --- nix/nixpkgs.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 nix/nixpkgs.nix (limited to 'nix/nixpkgs.nix') diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix new file mode 100644 index 0000000..b5675fb --- /dev/null +++ b/nix/nixpkgs.nix @@ -0,0 +1,27 @@ + +let + # Manage this with https://github.com/nmattia/niv + # or define { nixpkgs = ...; nixpkgs-mozilla = ...; } + # yourself. + sources = import ./sources.nix; + + rustChannelsOverlay = import "${sources.nixpkgs-mozilla}/rust-overlay.nix"; + # Useful if you also want to provide that in a nix-shell since some rust tools depend + # on that. + rustChannelsSrcOverlay = import "${sources.nixpkgs-mozilla}/rust-src-overlay.nix"; + +in import sources.nixpkgs { + overlays = [ + rustChannelsOverlay + rustChannelsSrcOverlay + (self: super: { + # Replace "latest.rustChannels.stable" with the version of the rust tools that + # you would like. Look at the documentation of nixpkgs-mozilla for examples. + # + # NOTE: "rust" instead of "rustc" is not a typo: It will include more than needed + # but also the much needed "rust-std". + rustc = super.latest.rustChannels.stable.rust; + inherit (super.latest.rustChannels.stable) cargo rust rust-fmt rust-std clippy; + }) + ]; + } -- cgit v1.2.3