Last active
March 23, 2021 03:07
-
-
Save ymatsiuk/685fe9519723d77ae34e5aa6e59172f9 to your computer and use it in GitHub Desktop.
This is how you build bluez:master on NixOS (no ELL support)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, ... }: | |
{ | |
hardware.bluetooth = { | |
enable = true; | |
package = pkgs.bluez-master; | |
powerOnBoot = true; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ bluez | |
, fetchFromGitHub | |
, autoconf | |
, automake | |
, libtool | |
}: | |
bluez.overrideAttrs (oldAttrs: rec { | |
version = "master"; | |
src = fetchFromGitHub { | |
owner = "bluez"; | |
repo = "bluez"; | |
rev = "2af9ef2fa0a3aee7bbeb7fd2c10205dd5fcfd2d3"; | |
sha256 = "sha256-Z0KcYF0RMn/R/RBH7/5+c4wj0TnblZI/UASS25AtcTs="; | |
}; | |
buildInputs = oldAttrs.buildInputs ++ [ autoconf automake libtool ]; | |
preConfigure = '' | |
./bootstrap | |
''; | |
configureFlags = [ | |
"--localstatedir=/var" | |
"--enable-library" | |
"--enable-cups" | |
"--enable-pie" | |
"--with-dbusconfdir=${placeholder "out"}/share" | |
"--with-dbussystembusdir=${placeholder "out"}/share/dbus-1/system-services" | |
"--with-dbussessionbusdir=${placeholder "out"}/share/dbus-1/services" | |
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" | |
"--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user" | |
"--with-udevdir=${placeholder "out"}/lib/udev" | |
"--enable-health" | |
"--enable-midi" | |
"--enable-nfc" | |
"--enable-sap" | |
"--enable-sixaxis" | |
"--enable-wiimote" | |
]; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
imports = | |
[ | |
./bluetooth.nix | |
./pipewire.nix | |
]; | |
nixpkgs.overlays = [ | |
(import ./overlays.nix) | |
]; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenvNoCC, fetchgit, lib }: | |
stdenvNoCC.mkDerivation rec { | |
pname = "firmware-linux-nonfree"; | |
version = "2020-12-18"; | |
src = fetchgit { | |
url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"; | |
rev = "refs/tags/" + lib.replaceStrings ["-"] [""] version; | |
sha256 = "sha256-ZQ2gbWq6XEqF5Cz8NsMGccevccDmXOymiavM/t1YZeU="; | |
}; | |
installFlags = [ "DESTDIR=$(out)" ]; | |
# Firmware blobs do not need fixing and should not be modified | |
dontFixup = true; | |
outputHashMode = "recursive"; | |
outputHashAlgo = "sha256"; | |
outputHash = "sha256-hgTfrOmKKpVK+qGuaFtFURLCwcG/cCiT4UYx7qCw+9w="; | |
meta = with lib; { | |
description = "Binary firmware collection packaged by kernel.org"; | |
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"; | |
license = licenses.unfreeRedistributableFirmware; | |
platforms = platforms.linux; | |
maintainers = with maintainers; [ fpletz ]; | |
priority = 6; # give precedence to kernel firmware | |
}; | |
passthru = { inherit version; }; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self: super: | |
{ | |
bluez-master = super.callPackage ./bluez-master.nix { }; | |
pipewire-bluez-master = super.callPackage ./pipewire-bluez-master.nix { }; | |
firmwareLinuxNonfree = super.callPackage ./firmware-linux-nonfree.nix { }; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pipewire | |
, alsaLib | |
, dbus | |
, glib | |
, libjack2 | |
, libsndfile | |
, ncurses | |
, udev | |
, vulkan-headers | |
, vulkan-loader | |
, valgrind | |
, SDL2 | |
, systemd | |
, gst_all_1 | |
, ffmpeg | |
, bluez-master | |
, libopenaptx | |
, ldacbt | |
, sbc | |
, fdk_aac | |
}: | |
pipewire.overrideAttrs (oldAttrs: rec { | |
buildInputs = [ | |
alsaLib | |
dbus | |
glib | |
libjack2 | |
libsndfile | |
ncurses | |
udev | |
vulkan-headers | |
vulkan-loader | |
valgrind | |
SDL2 | |
systemd | |
gst_all_1.gst-plugins-base | |
gst_all_1.gstreamer | |
ffmpeg | |
bluez-master | |
libopenaptx | |
ldacbt | |
sbc | |
fdk_aac | |
]; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, ... }: | |
{ | |
services.pipewire = { | |
enable = true; | |
package = pkgs.pipewire-bluez-master; | |
media-session.package = pkgs.pipewire-bluez-master.mediaSession; | |
alsa.enable = true; | |
pulse.enable = true; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment