From bf30b22665ef596f8627559bd8378d7ab6fbbd47 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 13 May 2021 22:31:12 +0530 Subject: update env --- flake.nix | 91 +++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/flake.nix b/flake.nix index d910720..6e9f56b 100644 --- a/flake.nix +++ b/flake.nix @@ -9,49 +9,52 @@ }; outputs = { self, nixpkgs, utils, naersk, mozillapkgs }: - utils.lib.eachDefaultSystem (system: let - pkgs = nixpkgs.legacyPackages."${system}"; + utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; - # Get a specific rust version - mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") {}; - rust = (mozilla.rustChannelOf { - date = "2020-12-23"; - channel = "nightly"; - sha256 = "LbKHsCOFXWpg/SEyACfzZuWjKbkXdH6EJKOPSGoO01E="; # set zeros after modifying channel or date - }).rust; - rust-src = (mozilla.rustChannelOf { - date = "2020-12-23"; - channel = "nightly"; - sha256 = "LbKHsCOFXWpg/SEyACfzZuWjKbkXdH6EJKOPSGoO01E="; # set zeros after modifying channel or date - }).rust-src; + # Get a specific rust version + mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { }; + chanspec = { + date = "2021-03-31"; + channel = "nightly"; + sha256 = "oK5ebje09MRn988saJMT3Zze/tRE7u9zTeFPV1CEeLc="; # set zeros after modifying channel or date + }; - naersk-lib = naersk.lib."${system}".override { - cargo = rust; - rustc = rust; - }; - in rec { - packages.my-project = naersk-lib.buildPackage { - pname = "dijo"; - version = "0.2.7"; - root = ./.; - }; - defaultPackage = packages.my-project; - apps.my-project = utils.lib.mkApp { - drv = packages.my-project; - }; - defaultApp = apps.my-project; - devShell = pkgs.mkShell { - nativeBuildInputs = [ - rust - rust-src - pkgs.rust-analyzer - pkgs.cargo - pkgs.openssl - pkgs.ncurses - ]; - shellHook = '' - export RUST_SRC_PATH="${rust-src}/lib/rustlib/src/rust/library" - ''; - }; - }); - } + rustChannel = mozilla.rustChannelOf chanspec; + rust = rustChannel.rust; + rust-src = rustChannel.rust-src; + + + naersk-lib = naersk.lib."${system}".override { + cargo = rust; + rustc = rust; + }; + in + rec { + packages.my-project = naersk-lib.buildPackage { + pname = "dijo"; + version = "0.2.7"; + root = ./.; + }; + defaultPackage = packages.my-project; + apps.my-project = utils.lib.mkApp { + drv = packages.my-project; + }; + defaultApp = apps.my-project; + devShell = pkgs.mkShell { + nativeBuildInputs = [ + rust + rust-src + pkgs.rust-analyzer + pkgs.cargo + pkgs.openssl + pkgs.ncurses + ]; + RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library"; + RUST_LOG = "info"; + RUST_BACKTRACE = 1; + + }; + }); +} -- cgit v1.2.3