-
Notifications
You must be signed in to change notification settings - Fork 7
/
flake.nix
54 lines (53 loc) · 1.47 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
54
{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
cargo2nix = {
url = "github:cargo2nix/cargo2nix/release-0.11.0";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.rust-overlay.follows = "rust-overlay";
};
};
outputs = {
naersk,
nixpkgs,
rust-overlay,
self,
flake-utils,
cargo2nix,
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [cargo2nix.overlays.default];
pkgs = (import nixpkgs) {inherit system overlays;};
workspaceShell = rustPkgs.workspaceShell {
# This adds cargo2nix to the project shell via the cargo2nix flake
packages = [cargo2nix.packages."${system}".cargo2nix];
};
rustPkgs = pkgs.rustBuilder.makePackageSet {
packageFun = import ./Cargo.nix;
rustVersion = "1.73.0";
extraRustComponents = [
"rust-analyzer"
"clippy"
];
};
in rec {
devShells = {
default = workspaceShell; # nix develop
};
packages = {
dmux = (rustPkgs.workspace.dmux {}).bin;
default = packages.dmux;
};
apps = rec {
dmux = {
type = "app";
program = "${packages.default}/bin/dmux";
};
default = dmux;
};
});
}