-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
53 lines (51 loc) · 1.3 KB
/
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
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
{
description = "Beans";
inputs = {
naersk.url = "github:nmattia/naersk/master";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = github:oxalica/rust-overlay;
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "utils";
};
};
};
outputs = { self, nixpkgs, utils, naersk, rust-overlay }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlays.default
];
};
rust = pkgs.rust-bin.nightly.latest.default.override {
extensions = [ "rust-src" "clippy" ];
};
naersk-lib = naersk.lib.${system}.override {
cargo = rust;
rustc = rust;
};
in {
defaultPackage = naersk-lib.buildPackage {
pname = "Beans";
root = ./.;
};
defaultApp = utils.lib.mkApp {
drv = self.defaultPackage.${system};
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
gdb
rust
cargo
cargo-edit
rustfmt
clippy
rust-analyzer
];
};
});
}