Add alsa-lib to shell.nix and flake.nix for audio support Reference: https://github.com/mackron/miniaudio/issues/267#issuecomment-770345648

replicaCortex
2025-08-07 19:46:02 +03:00
parent 1562b91e7b
commit 0aa871e571

@ -227,14 +227,19 @@ tar xvf external/5.5.tar.gz -C external/
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self , nixpkgs ,... }: let
outputs = {
self,
nixpkgs,
...
}: let
system = "x86_64-linux";
in {
devShells."${system}".default = let
pkgs = import nixpkgs {
inherit system;
};
in pkgs.mkShell {
in
pkgs.mkShell {
packages = [
pkgs.libGL
@ -249,6 +254,9 @@ tar xvf external/5.5.tar.gz -C external/
# Uncomment the line below if you want to build Raylib with web support
# pkgs.emscripten
];
# Audio dependencies
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.alsa-lib];
};
};
}
@ -264,9 +272,8 @@ nix develop
Alternatively, you can create a `shell.nix` file in the root folder of your project with the following content:
```nix
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
{pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
nativeBuildInputs = [
pkgs.libGL
@ -281,6 +288,9 @@ Alternatively, you can create a `shell.nix` file in the root folder of your proj
# Web support (uncomment to enable)
# pkgs.emscripten
];
# Audio dependencies
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.alsa-lib];
}
```