Skip to content

Instantly share code, notes, and snippets.

@patrickod
Last active December 3, 2021 17:25
Show Gist options
  • Save patrickod/faf79a066226a972eabd63dab841a065 to your computer and use it in GitHub Desktop.
Save patrickod/faf79a066226a972eabd63dab841a065 to your computer and use it in GitHub Desktop.
Nix flake for graphic, audio programming with Rust and the Nannou framework
{
description = "rust nannou graphics & art development";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
with nixpkgs;
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.stable."1.56.1".default.override {
extensions = [
"clippy-preview"
"rust-src"
"rustfmt-preview"
"rust-analysis"
];
};
in
{
devShell = pkgs.mkShell rec {
buildInputs = [
rust
pkgs.cmake
pkgs.pkg-config
pkgs.python39
pkgs.alsa-lib
pkgs.xorg.libX11
pkgs.xorg.libXcursor
pkgs.xorg.libXrandr
pkgs.xorg.libXi
pkgs.vulkan-tools
pkgs.vulkan-headers
pkgs.vulkan-loader
pkgs.vulkan-validation-layers
];
# important environment variables
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment