Skip to content

Commit 71b9817

Browse files
committed
add nixos development shell
1 parent 80e1544 commit 71b9817

2 files changed

Lines changed: 125 additions & 0 deletions

File tree

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
description = "Polyblade development shell";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
cargo-binstall = pkgs.rustPlatform.buildRustPackage rec {
14+
pname = "cargo-binstall";
15+
version = "1.16.0";
16+
src = pkgs.fetchCrate {
17+
inherit pname version;
18+
hash = "sha256-YvNoAFI8Sx34Gl1+V0dUGsYglqGIUp0HSwi9cdlW7FU=";
19+
};
20+
cargoHash = "sha256-9w17tZ8vkqyebtPK4LzaGELeb15pLGMwWzr7DFyYVms=";
21+
nativeBuildInputs = with pkgs; [ pkg-config openssl.dev ];
22+
buildInputs = with pkgs; [
23+
openssl
24+
glib
25+
gtk3
26+
libsoup_3
27+
webkitgtk_4_1
28+
xdotool
29+
];
30+
};
31+
runtimeLibs = with pkgs; [
32+
wayland
33+
wayland-protocols
34+
libxkbcommon
35+
vulkan-loader
36+
libGL
37+
libx11
38+
libxcursor
39+
libxi
40+
libxrandr
41+
libxxf86vm
42+
];
43+
in {
44+
devShells.default = pkgs.mkShell {
45+
nativeBuildInputs = with pkgs; [
46+
pkg-config
47+
cargo
48+
rust-analyzer
49+
rustfmt
50+
rustc
51+
lld
52+
graphviz
53+
cargo-binstall
54+
];
55+
56+
buildInputs = with pkgs;
57+
[ vulkan-headers vulkan-validation-layers ] ++ runtimeLibs;
58+
59+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeLibs;
60+
VK_LAYER_PATH =
61+
"${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
62+
};
63+
});
64+
}

0 commit comments

Comments
 (0)