Skip to content

Commit b6421f2

Browse files
author
Yara 🏳️‍⚧️
authored
Merge pull request #814 from RustAudio/add-nix-flake
adds flake to facilitate development on nixos
2 parents 3ac5c5c + 1e18752 commit b6421f2

3 files changed

Lines changed: 132 additions & 0 deletions

File tree

flake.lock

Lines changed: 96 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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
inputs = {
3+
utils.url = "github:numtide/flake-utils";
4+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
rust-overlay.url = "github:oxalica/rust-overlay";
6+
};
7+
outputs =
8+
inputs: inputs.utils.lib.eachDefaultSystem (
9+
system: let
10+
pkgs = inputs.nixpkgs.legacyPackages.${system}.extend inputs.rust-overlay.overlays.default;
11+
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
12+
in {
13+
devShell = pkgs.mkShell {
14+
nativeBuildInputs = with pkgs; [
15+
rust
16+
] ++ lib.optionals pkgs.stdenv.isLinux [
17+
pkg-config
18+
];
19+
20+
buildInputs = with pkgs; [] ++ lib.optionals pkgs.stdenv.isLinux [
21+
alsa-lib
22+
];
23+
};
24+
}
25+
);
26+
}

rust-toolchain.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[toolchain]
2+
channel = "1.91"
3+
components = [
4+
"rustc",
5+
"cargo",
6+
"clippy",
7+
"rustfmt",
8+
"rust-analyzer",
9+
"rust-src",
10+
]

0 commit comments

Comments
 (0)