-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
92 lines (83 loc) · 2.5 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
description = "Realtime Vulkan ray tracing";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay,... }: let
lib = {
inherit (flake-utils.lib) defaultSystems eachSystem;
};
supportedSystems = [ "x86_64-linux" ];
in lib.eachSystem supportedSystems (system: let
nightlyVersion = "2023-01-15";
#pkgs = mars-std.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
overlays = [
(import rust-overlay)
#(import ./pkgs)
];
};
pinnedRust = pkgs.rust-bin.nightly.${nightlyVersion}.default.override {
extensions = ["rustc-dev" "rust-src" "rust-analyzer-preview" ];
targets = [ "x86_64-unknown-linux-gnu" ];
};
rustPlatform = pkgs.makeRustPlatform {
rustc = pinnedRust;
cargo = pinnedRust;
};
cargoExpand = pkgs.cargo-expand.override { inherit rustPlatform; };
cargoFlame = pkgs.cargo-flamegraph.override { inherit rustPlatform; };
#cargoMSRV = pkgs.cargo-msrv.override { inherit rustPlatform; };
cargoBloat = pkgs.cargo-bloat.override { inherit rustPlatform; };
cargoLicense = pkgs.cargo-license.override { inherit rustPlatform; };
cargo-supply-chain = pkgs.cargo-supply-chain.override { inherit rustPlatform; };
#cargoREADME = pkgs.cargo-readme.override { inherit rustPlatform; };
#cargoFeature = pkgs.cargo-feature.override { inherit rustPlatform; };
#cargoGeiger = pkgs.cargo-geiger.override { inherit rustPlatform; };
in {
devShell = pkgs.mkShell rec {
hardeningDisable = [
"fortify"
];
nativeBuildInputs = [
pinnedRust
cargoExpand
cargoFlame
cargoBloat
cargoLicense
cargo-supply-chain
#cargoREADME
#cargoFeature
#cargoGeiger
#cargoMSRV
];
buildInputs = with pkgs; [
# alsaLib
# binaryen
fontconfig
# freetype
# libxkbcommon
pkg-config
# spirv-tools
#udev
vulkan-loader
vulkan-tools
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
shaderc
#renderdoc
# gcc-unwrapped.lib
];
VULKAN_SDK = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${ pkgs.lib.makeLibraryPath buildInputs}"
'';
};
});
}