Skip to content

replace nix shell by flake #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
description = "Honeycomb development & build environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};

# Rust toolchain with extensions
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
};

# Platform-specific build inputs
linuxBuildInputs = with pkgs; [
xorg.libX11
xorg.libXcursor
xorg.libXi
libxkbcommon
xorg.libxcb
libudev-zero
vulkan-loader
glfw
];

buildInputs = with pkgs; [
hwloc.dev
] ++ (if pkgs.stdenv.isLinux then linuxBuildInputs else []);

# Platform-specific LD_LIBRARY_PATH
ldLibraryPath = pkgs.lib.makeLibraryPath (
[ pkgs.hwloc.lib ] ++
(if pkgs.stdenv.isLinux then linuxBuildInputs else [])
);

in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rustToolchain
cargo
rust-analyzer
pkg-config
];

buildInputs = buildInputs;

shellHook = ''
export LD_LIBRARY_PATH=${ldLibraryPath}:$LD_LIBRARY_PATH
'';
};
});
}
38 changes: 0 additions & 38 deletions shell.nix

This file was deleted.