-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (53 loc) · 1.63 KB
/
flake.nix
File metadata and controls
60 lines (53 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
nixpkgs-rust.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs-rust";
};
};
outputs = inputs @ { self, ...}:
inputs.utils.lib.eachDefaultSystem (system:
let
pkgs = import inputs.nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage inputs.naersk { };
pkgs-rust = import inputs.nixpkgs-rust {
inherit system;
overlays = [ inputs.rust-overlay.overlays.default ];
};
rust-config = {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
};
# rust toolchain for services
rust = (pkgs-rust.rust-bin.fromRustupToolchainFile ./rust-toolchain).override rust-config;
# rustfmt from rust-nightly used for advanced options in rustfmt
rustfmt-nightly = pkgs-rust.rust-bin.nightly.latest.rustfmt;
in
{
defaultPackage = naersk-lib.buildPackage ./.;
devShell = with pkgs; mkShell {
buildInputs = [
cargo
chromedriver
geckodriver
just
openssl
pcsclite
present-cli
prek
pkg-config
rustfmt-nightly
rust
rustPackages.clippy
wasm-pack
wasm-bindgen-cli
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
}
);
}