Skip to content

Commit

Permalink
added nix devshell
Browse files Browse the repository at this point in the history
  • Loading branch information
gerwin3 committed Aug 30, 2024
1 parent c2ef604 commit b450026
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
82 changes: 82 additions & 0 deletions flake.lock

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

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};

outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
nativeBuildInputs = with pkgs; [
(pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)

# Used by ffmpeg-next-sys to find ffmpeg libraries.
pkg-config
# Used by ffmpeg-next-sys via bindgen to generate bindings.
llvmPackages.libclang

# Without this bindgen will not be able to find libclang and won't be
# able to generate bindings.
rustPlatform.bindgenHook
];
buildInputs = with pkgs; [
ffmpeg
];
in
with pkgs;
{
devShells.default = mkShell {
inherit buildInputs nativeBuildInputs;
};
}
);
}
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
profile = "default"
components = ["rust-analyzer"]

0 comments on commit b450026

Please sign in to comment.