1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 04:51:31 +03:00
mobile-nixos/devices/pine64-pinetab/sound.nix
2021-03-23 21:17:18 -07:00

26 lines
780 B
Nix

# PineTab UCM files
#
# A hack to avoid mass rebuilds of packages that depend on
# alsaLib.
#
# UCM files taken from
# https://github.com/dreemurrs-embedded/Pine64-Arch/tree/02bf6ffafcab0a3c29e3b62b77b8e353d50d4706/PKGBUILDS/pine64/alsa-ucm-pinetab
{ config, lib, ... }:
let
ucm2 = "${./ucm2}";
in {
config = lib.mkMerge [
(lib.mkIf config.sound.enable {
environment.variables.ALSA_CONFIG_UCM2 = ucm2;
})
(lib.mkIf (config.hardware.pulseaudio.enable && !config.hardware.pulseaudio.systemWide) {
systemd.user.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = ucm2;
})
(lib.mkIf (config.hardware.pulseaudio.enable && config.hardware.pulseaudio.systemWide) {
systemd.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = ucm2;
})
];
}