aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix85
1 files 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 @@
9 }; 9 };
10 10
11 outputs = { self, nixpkgs, utils, naersk, mozillapkgs }: 11 outputs = { self, nixpkgs, utils, naersk, mozillapkgs }:
12 utils.lib.eachDefaultSystem (system: let 12 utils.lib.eachDefaultSystem (system:
13 pkgs = nixpkgs.legacyPackages."${system}"; 13 let
14 pkgs = nixpkgs.legacyPackages."${system}";
14 15
15 # Get a specific rust version 16 # Get a specific rust version
16 mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") {}; 17 mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { };
17 rust = (mozilla.rustChannelOf { 18 chanspec = {
18 date = "2020-12-23"; 19 date = "2021-03-31";
19 channel = "nightly"; 20 channel = "nightly";
20 sha256 = "LbKHsCOFXWpg/SEyACfzZuWjKbkXdH6EJKOPSGoO01E="; # set zeros after modifying channel or date 21 sha256 = "oK5ebje09MRn988saJMT3Zze/tRE7u9zTeFPV1CEeLc="; # set zeros after modifying channel or date
21 }).rust; 22 };
22 rust-src = (mozilla.rustChannelOf { 23 rust = (mozilla.rustChannelOf chanspec).rust;
23 date = "2020-12-23"; 24 rust-src = (mozilla.rustChannelOf chanspec).rust-src;
24 channel = "nightly";
25 sha256 = "LbKHsCOFXWpg/SEyACfzZuWjKbkXdH6EJKOPSGoO01E="; # set zeros after modifying channel or date
26 }).rust-src;
27 25
28 naersk-lib = naersk.lib."${system}".override { 26 naersk-lib = naersk.lib."${system}".override {
29 cargo = rust; 27 cargo = rust;
30 rustc = rust; 28 rustc = rust;
31 }; 29 };
32 in rec { 30 in
33 packages.my-project = naersk-lib.buildPackage { 31 rec {
34 pname = "dijo"; 32 packages.my-project = naersk-lib.buildPackage {
35 version = "0.2.6"; 33 pname = "obi";
36 root = ./.; 34 version = "0.1.0";
37 }; 35 root = ./.;
38 defaultPackage = packages.my-project; 36 };
39 apps.my-project = utils.lib.mkApp { 37 defaultPackage = packages.my-project;
40 drv = packages.my-project; 38 apps.my-project = utils.lib.mkApp {
41 }; 39 drv = packages.my-project;
42 defaultApp = apps.my-project; 40 };
43 devShell = pkgs.mkShell { 41 defaultApp = apps.my-project;
44 nativeBuildInputs = [ 42 devShell = pkgs.mkShell {
45 rust 43 nativeBuildInputs = [
46 rust-src 44 rust
47 pkgs.rust-analyzer 45 rust-src
48 pkgs.cargo 46 pkgs.rust-analyzer
49 pkgs.openssl 47 pkgs.rustfmt
50 pkgs.ncurses 48 pkgs.cargo
51 ]; 49 ];
52 RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; 50 RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library";
53 }; 51 RUST_LOG = "info";
54 }); 52 RUST_BACKTRACE = 1;
55 } 53
54 };
55 });
56}