-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
55 lines (48 loc) · 1.63 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
55
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
cargo-smart-release-src = {
url = "github:Byron/cargo-smart-release/v0.21.3";
flake = false;
};
};
outputs = { self, flake-utils, naersk, nixpkgs, cargo-smart-release-src }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs) {
inherit system;
};
inherit (pkgs) lib;
naersk' = pkgs.callPackage naersk {};
nativeBuildInputs = with pkgs; [ cmake ninja pkg-config ];
buildInputs = with pkgs; [
udev alsa-lib vulkan-loader
xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr # To use the x11 feature
libxkbcommon wayland # To use the wayland feature
];
cargo-smart-release = naersk'.buildPackage {
inherit nativeBuildInputs;
buildInputs = with pkgs; [openssl];
src = cargo-smart-release-src;
singleStep = true;
};
bevy-kira-components = naersk'.buildPackage {
inherit nativeBuildInputs;
buildInputs = with pkgs; [pkg-config alsa-lib];
src = ./.;
};
in {
packages = {
inherit cargo-smart-release bevy-kira-components;
default = bevy-kira-components;
};
# For `nix develop`:
devShell = pkgs.mkShell {
nativeBuildInputs = nativeBuildInputs ++ buildInputs ++ [cargo-smart-release];
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
};
}
);
}