Add absolute volume to pulseaudio

This commit is contained in:
Alexander Bantyev 2020-08-04 18:03:41 +03:00
parent d93277c933
commit cdada48f7f
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
2 changed files with 24 additions and 7 deletions

6
flake.lock generated
View File

@ -106,11 +106,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1593628299, "lastModified": 1596549673,
"narHash": "sha256-TG05BV4fbJdDW4RzoYBYaGdFtOq6NNet1JHjP1Au/VE=", "narHash": "sha256-1wQvqbDFWxO53ZsNHv3CFxjoCwjQ3HTFhitGIh3/a88=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0", "rev": "4e7f1c7f11fb22d7954b2dacbe87c61548fab82d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -15,7 +15,16 @@ with deviceSpecific; {
hardware.opengl.package = pkgs.mesa_drivers; hardware.opengl.package = pkgs.mesa_drivers;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.bluetooth.package = pkgs.bluezFull; hardware.bluetooth.package = pkgs.bluezFull.overrideAttrs (_: {
patches = [
(pkgs.fetchurl {
name = "volume-patch";
url = "https://marc.info/?l=linux-bluetooth&m=159446824521591&q=raw";
sha256 =
"448ce22b6fec2746d075390a898d1d08828c4008a6efcd8b98825ec60e5d1b81";
})
];
});
services.throttled = { services.throttled = {
enable = device == "T490s-Laptop"; enable = device == "T490s-Laptop";
@ -80,7 +89,8 @@ with deviceSpecific; {
enable = config.device == "T490s-Laptop"; enable = config.device == "T490s-Laptop";
description = "Set up thinkpad leds"; description = "Set up thinkpad leds";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
script = ''echo -n -e "\x0e" | dd of="/sys/kernel/debug/ec/ec0/io" bs=1 seek=12 count=1 conv=notrunc 2> /dev/null''; script = ''
echo -n -e "\x0e" | dd of="/sys/kernel/debug/ec/ec0/io" bs=1 seek=12 count=1 conv=notrunc 2> /dev/null'';
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
}; };
@ -119,11 +129,18 @@ with deviceSpecific; {
sound.enable = true; sound.enable = true;
hardware.pulseaudio = { hardware.pulseaudio = {
enable = true; enable = true;
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull.overrideAttrs (oa: {
patches = [
(pkgs.fetchurl {
url =
"https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/239.diff";
sha256 = "07qrpqwvn9sr87z2kn1yaza5bs9ivywd7sl194zwphlq94xrlzdf";
})
];
});
support32Bit = true; support32Bit = true;
extraConfig = '' extraConfig = ''
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
''; '';
extraModules = [ pkgs.pulseaudio-modules-bt ];
}; };
} }