Permission issue fails nixos-rebuild

Running sudo nixos-rebuild results in:

error: builder for '/nix/store/jka5w6xgkkjz8bfcmz0x522lj3a0b3aq-etc.drv' failed with exit code 1;
       last 1 log lines:
       > mkdir: cannot create directory '/nix/store/p0kgcra5fyq0a4ny04cinln68dbrk3ia-etc/etc/pipewire/pipewire-pulse.d': Permission denied
       For full logs, run 'nix log /nix/store/jka5w6xgkkjz8bfcmz0x522lj3a0b3aq-etc.drv'.

Nix log provide no additional information. If I disable pulse support the rebuild fails with the same permission issue but for a different dir (etc/wireplumber/bluetooth.lua.d) and so on.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.5-xanmod1, NixOS, 24.05 (Uakari), 24.05.20240221.0e74ca9`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.19.3`
 - nixpkgs: `/nix/store/gzf4zwcakda1nykn6h0avh45xhjhvsz4-source`
1 Like

I had this or a very similar issue and it seemed to be the bluetooth config has changed. I commented out the following and seem to have had no adverse affects:

environment = {

etc = {

“wireplumber/bluetooth.lua.d/51-bluez-config.lua”.text = ‘’

bluez_monitor.properties = {

[“bluez5.enable-sbc-xq”] = true,

[“bluez5.enable-msbc”] = true,

[“bluez5.enable-hw-volume”] = true,

[“bluez5.headset-roles”] = “[ hsp_hs hsp_ag hfp_hf hfp_ag ]”

}

‘’;

};

variables = {

VK_ICD_FILENAMES = “/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json”;

  #      VK_ICD_FILENAMES = "/run/opengl-driver-32/share/vulkan/icd.d/amd_icd.i686.json";

};

};

(Ignore Vulkan variables)

Not sure what has chagewd, but hope this helps!

Looks like it is the addition of pipewire-extra-config and wireplumber-configs. Do you something like

      # pulse clients config
      environment.etc."pipewire/pipewire-pulse.d/99-lowlatency.conf" = { ... }

It seems that in the latest version things have changed and now you need to specify configurations through services.pipewire.extraConfig.pipewire.

You can check the other configs here: options for services.pipewire

I guess it also changed for wireplumer configurations

Here is how my config looks like now after changing it to this new way:

  services.pipewire = {
    enable = true;
    wireplumber.enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;
    extraConfig = {
      pipewire = {
        "92-low-latency.conf" = {
          context.properties = {
            default.clock.rate = 48000;
            default.clock.quantum = 1024;
            default.clock.min-quantum = 1024;
            default.clock.max-quantum = 1024;
          };
        };
      };
    };
  };

1 Like

That doesn’t seem to work for me:

  services.pipewire.wireplumber.configPackages."51-bluez-config.lua" = {
    bluez_monitor.properties = {
      "bluez5.enable-sbc-xq" = true;
      "bluez5.enable-msbc" = true;
      "bluez5.enable-hw-volume" = true;
      "bluez5.headset-roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag"];
    };
  };
       error: A definition for option `services.pipewire.wireplumber.configPackages' is not of type `list of package'. Definition values:

How do I turn this into a package?

edit: yeah this is definitely a different type:

List of packages that provide WirePlumber configuration, in the form of share/wireplumber/*/*.lua files.

LV2 dependencies will be picked up from config packages automatically via passthru.requiredLv2Packages.