-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
26 lines (24 loc) · 887 Bytes
/
flake.nix
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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, flake-utils, naersk, nixpkgs, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
naersk' = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
in rec {
# For `nix build` & `nix run`:
defaultPackage = naersk'.buildPackage { src = ./.; };
# For `nix develop`:
devShell = pkgs.mkShell { nativeBuildInputs = [ toolchain ]; };
});
}