Commit 3ab04e0d authored by Florian Franzen's avatar Florian Franzen
Browse files

flake: add naersk build tool

parent d010de4d
...@@ -16,6 +16,26 @@ ...@@ -16,6 +16,26 @@
"type": "github" "type": "github"
} }
}, },
"naersk": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1614785451,
"narHash": "sha256-TPw8kQvr2UNCuvndtY+EjyXp6Q5GEW2l9UafXXh1XmI=",
"owner": "nmattia",
"repo": "naersk",
"rev": "e0fe990b478a66178a58c69cf53daec0478ca6f9",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1615879109, "lastModified": 1615879109,
...@@ -51,6 +71,7 @@ ...@@ -51,6 +71,7 @@
"root": { "root": {
"inputs": { "inputs": {
"mozilla": "mozilla", "mozilla": "mozilla",
"naersk": "naersk",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"polkadot-spec": "polkadot-spec", "polkadot-spec": "polkadot-spec",
"utils": "utils" "utils": "utils"
......
...@@ -11,11 +11,17 @@ ...@@ -11,11 +11,17 @@
# Overlay used for nightly rust support # Overlay used for nightly rust support
mozilla = { url = "github:mozilla/nixpkgs-mozilla"; flake = false; }; mozilla = { url = "github:mozilla/nixpkgs-mozilla"; flake = false; };
# Rust build tool
naersk = {
url = "github:nmattia/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
# Polkadot specification and testsuite repo # Polkadot specification and testsuite repo
polkadot-spec = { url = "github:w3f/polkadot-spec"; flake = false; }; polkadot-spec = { url = "github:w3f/polkadot-spec"; flake = false; };
}; };
outputs = { self, utils, nixpkgs, ... } @ sources : outputs = { self, utils, nixpkgs, naersk, ... } @ sources :
utils.lib.eachDefaultSystem (system: utils.lib.eachDefaultSystem (system:
let let
rust-overlay = import "${sources.mozilla}/rust-overlay.nix"; rust-overlay = import "${sources.mozilla}/rust-overlay.nix";
...@@ -24,6 +30,7 @@ ...@@ -24,6 +30,7 @@
inherit system; inherit system;
overlays = [ overlays = [
self.overlay self.overlay
naersk.overlay
rust-overlay rust-overlay
]; ];
}; };
......
...@@ -8,7 +8,19 @@ let ...@@ -8,7 +8,19 @@ let
# Support derivations and environments used during build # Support derivations and environments used during build
support = with final; { support = with final; {
# Nigthly rust with rust-std for wasm target # Nigthly rust with rust-std for wasm target
rustWasmPlatform = callPackage ./support/rust.nix {}; rustWasm = callPackage ./support/rustWasm.nix {};
# Platform with nightly wasm rust
rustWasmPlatform = makeRustPlatform {
rustc = rustWasm;
cargo = rustWasm;
};
# Naersk with nightly and rust
naerskWasm = naersk.override {
rustc = rustWasm;
cargo = rustWasm;
};
}; };
# Dependency derivations (buildable) # Dependency derivations (buildable)
......
...@@ -6,9 +6,5 @@ let ...@@ -6,9 +6,5 @@ let
channel = "nightly"; channel = "nightly";
sha256 = "16r5lldank00c2bhnrzr1bxfsbvqxzcap5zmh40ri46x0jfbx8jh"; sha256 = "16r5lldank00c2bhnrzr1bxfsbvqxzcap5zmh40ri46x0jfbx8jh";
}; };
rust_wasm = channel.rust.override { targets = [ "wasm32-unknown-unknown" ]; }; in
in channel.rust.override { targets = [ "wasm32-unknown-unknown" ]; }
makeRustPlatform {
rustc = rust_wasm;
cargo = rust_wasm;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment