mobile-nixos icon indicating copy to clipboard operation
mobile-nixos copied to clipboard

The option `sound' can no longer be used since it's been removed

Open Luflosi opened this issue 1 year ago • 9 comments

Since https://github.com/NixOS/nixpkgs/commit/3eeff54780a1a8c73c82ca51987962b62bd4219e was merged, evaluating a configuration for the PinePhone fails with the error message "error: The option `sound' can no longer be used since it's been removed. The option was heavily overloaded and can be removed from most configurations.".

All uses of this option should be removed/replaced in Mobile NixOS. I don't know enough about how sound on the PinePhone actually works to feel comfortable doing this myself.

Maybe this is all that is needed:

--- a/devices/pine64-pinephone/sound.nix
+++ b/devices/pine64-pinephone/sound.nix
@@ -10,9 +10,6 @@ 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;
     })
--- a/devices/pine64-pinetab/sound.nix
+++ b/devices/pine64-pinetab/sound.nix
@@ -12,9 +12,6 @@ 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;
     })

Cc @K900.

Luflosi avatar Jul 24 '24 09:07 Luflosi

Did you find a way to solve this issue?

Thatoo avatar Sep 01 '24 14:09 Thatoo

@Luflosi FWIW I applied your change to my local clone of mobile-nixos and was able to go through nixos-rebuild switch. I can confirm the sound still works (just checked if youtube in browser produces sound - it does). I did not check if calls work though.

kazikcz avatar Sep 02 '24 05:09 kazikcz

I've been using this change for almost 2 months now and calls do work

donovanglover avatar Sep 03 '24 17:09 donovanglover

Would you mind @kazikcz and @donovanglover how you applied this change in your pinephone?

Thatoo avatar Sep 03 '24 17:09 Thatoo

@Thatoo I git cloned the mobile-nixos git repo into /nix/mobile-nixos/ (this path isn't special other then it gets used in another command later), and applied the change, commited, and then ran nixos-rebuild -I mobile-nixos=/nix/mobile-nixos switch (the mobile-nixos= is tied to channel name, see nix-channel --list in case you're wondering). To my limited understanding of nix, this overrides whatever the actual mobile-nixos channel looks like in a given generation (after --update). IOW this is one time, and if you want to pull in upgrades later, you'll need to do it through your cloned git repo (eg. git fetch + rebase) instead of just nix-channel --update and make sure you include the -I mobile-nixos=.. override.

kazikcz avatar Sep 03 '24 17:09 kazikcz

If you're using flakes it's as easy as changing the mobile-nixos input to your fork. Example.

donovanglover avatar Sep 03 '24 18:09 donovanglover

Thank you. I'll try on my side then.

Thatoo avatar Sep 03 '24 18:09 Thatoo

With flakes and pointing to your repo, it does work indeed. Thank you @donovanglover . I have question though. When my pinephone starts, it directly start to the last build. I can't choose among history of builds. Is it possible to make the pinephone show the list, and let me choose, before starting?

Thatoo avatar Sep 05 '24 17:09 Thatoo

If you mean previous generations you should be able to press the volume button during the first boot screen to enter recovery mode.

Note that my fork is highly experimental and tailored to my use case. No support will be provided for it.

donovanglover avatar Sep 05 '24 19:09 donovanglover