Maybe it’s part of nixpkgs.alsa-firmware? I would try that, and if that does not work, yes you could make a derivation that simply downloads the released files and populates a tree with them. Alternatively, you could create a derivation from the source, GitHub - thesofproject/sof: Sound Open Firmware.
I have a Lenovo C940 and with the 5.7 kernel I only needed to add
boot.blacklistedKernelModules = [ "snd_hda_intel" "snd_soc_skl" ];
# This can be removed when PulseAudio is at least version 14
# https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_7)#Audio
hardware.pulseaudio.extraConfig = ''
load-module module-alsa-sink device=hw:0,0 channels=4
load-module module-alsa-source device=hw:0,6 channels=4
'';
and I now have working microphone and 2 speakers (not the bass boosters though sadly)
I tried every solution in this post, but sound on my X1 Carbon Gen 7 never works. This is a new laptop, and it worked in the beginning - but somewhere along the upgrades (probably after fwupdmgr updates) it stopped working.
Has anyone figured a solution yet?
EDIT: Reverting to nixos 20.03 fixed it. Only happens on nixos-unstable.
@srid As far as I can tell, sof-firmware was introduced after the 20.03 release, so you’re probably using the legacy driver (and there’s nothing wrong with that). Come 20.09, I believe you’ll get SOF by default.
If it’s interesting, I have a working sound setup on my X1C7 running nixos-unstable (61525137fd10). I put my options pertaining to audio here and here.
Generally, audio on the X1C7 is a long story, but with Sound Open Firmware and PulseAudio 14 (as well as an upcoming kernel patch), I think it’s starting to come together.
Personally, I haven’t had any problems with the sound being completely gone, but judging from the discussion that I linked to above, you’re not alone.