-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
49 lines (43 loc) · 1.09 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
{
description = "lupin: a programming language";
inputs = {
naersk = {
url = "github:nix-community/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = {
self,
nixpkgs,
utils,
rust-overlay,
...
} @ inputs:
utils.lib.eachDefaultSystem (system: let
defaultBinName = "lupin_cli";
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
toolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain:
toolchain.default.override {
extensions = ["rust-analyzer"];
targets = [];
});
naersk = pkgs.callPackage inputs.naersk {
cargo = toolchain;
rustc = toolchain;
};
in {
defaultPackage = naersk.buildPackage {
pname = defaultBinName;
src = ./.;
};
devShell = pkgs.mkShell {
buildInputs = [toolchain];
};
});
}