From 63af58d6a3fd68bdb313305881627dab534346e2 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 18 Apr 2021 15:20:43 +0530 Subject: update env --- flake.nix | 85 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/flake.nix b/flake.nix index f467cd2..2e49eea 100644 --- a/flake.nix +++ b/flake.nix @@ -9,47 +9,48 @@ }; 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 + }; + rust = (mozilla.rustChannelOf chanspec).rust; + rust-src = (mozilla.rustChannelOf chanspec).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.6"; - 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 = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; - }; - }); - } + naersk-lib = naersk.lib."${system}".override { + cargo = rust; + rustc = rust; + }; + in + rec { + packages.my-project = naersk-lib.buildPackage { + pname = "obi"; + version = "0.1.0"; + 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.rustfmt + pkgs.cargo + ]; + RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library"; + RUST_LOG = "info"; + RUST_BACKTRACE = 1; + + }; + }); +} -- cgit v1.2.3