-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (47 loc) · 1.42 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
{
inputs = {
nixpkgs.url = "github:/NixOS/nixpkgs/nixos-24.05";
rust-overlay.url = "github:oxalica/rust-overlay";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, rust-overlay, naersk }:
let
system = "x86_64-linux";
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit overlays system; };
rust-bin = (pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
});
naersk-lib = naersk.lib.${system}.override {
cargo = rust-bin;
rustc = rust-bin;
};
dev-deps = with pkgs; [
rust-bin
rust-analyzer
rustfmt
lldb
cargo-geiger
wireshark
cargo-flamegraph
];
build-deps = with pkgs; [ pkg-config ];
runtime-deps = with pkgs; [ rtmidi alsa-lib.dev ];
in {
devShells.${system}.default = pkgs.mkShell {
buildInputs = dev-deps ++ build-deps ++ runtime-deps;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.alsa-lib ];
};
packages.${system}.midimaxe = naersk-lib.buildPackage {
name = "midimaxe";
root = ./.;
buildInputs = runtime-deps;
nativeBuildInputs = build-deps;
};
defaultPackage.${system} = self.packages.${system}.midimaxe;
};
}