No sound on GNOME, but on KDE Plasma

I am trying out NixOS and am quite impressed. Everything works on KDE Plasma (except screen tearing) I tried out GNOME and suddenly there are no sound devices but it works on KDE Plasma.

I thoroughly read GNOME, Pipewire Wiki Pages.

I applied the following breaking changes:

Subject: [PATCH] try out GNOME

---
 nixos/default.nix                     |  3 +++
 nixos/environment/system_packages.nix |  2 ++
 nixos/hardware/default.nix            |  2 +-
 nixos/services/default.nix            |  5 +++++
 nixos/services/xserver.nix            | 10 ++--------
 nixos/sound/default.nix               |  4 ++--
 6 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/nixos/default.nix b/nixos/default.nix
index d2c8af7..899d056 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -22,4 +22,7 @@
     ./users
     ./virtualisation
   ];
+
+  systemd.services."getty@tty1".enable = false;
+  systemd.services."autovt@tty1".enable = false;  
 }
diff --git a/nixos/environment/system_packages.nix b/nixos/environment/system_packages.nix
index 28244a4..e74e981 100644
--- a/nixos/environment/system_packages.nix
+++ b/nixos/environment/system_packages.nix
@@ -46,6 +46,8 @@
   gimp
   git
   gitAndTools.gitFull
+  gnomeExtensions.appindicator
+  gnome.adwaita-icon-theme
   gnome.ghex
   gnome.gnome-disk-utility
   gnome.gnome-keyring
diff --git a/nixos/hardware/default.nix b/nixos/hardware/default.nix
index 28d5df2..47c530c 100644
--- a/nixos/hardware/default.nix
+++ b/nixos/hardware/default.nix
@@ -45,7 +45,7 @@
       };
     };
 
-    # pulseaudio.enable = true; # TODO: conflicts with pipewire, bluetooth@wiki says enable this??
+    pulseaudio.enable = false;
 
     sane = {
       enable = true;
diff --git a/nixos/services/default.nix b/nixos/services/default.nix
index 972fd23..d0b6404 100644
--- a/nixos/services/default.nix
+++ b/nixos/services/default.nix
@@ -29,9 +29,14 @@ inputs @ { pkgs, ... }: {
     udev = {
       packages = with pkgs; [
         android-udev-rules
+        gnome.gnome-settings-daemon
       ];
     };
 
+    dbus = {
+      packages = with pkgs; [ gnome2.GConf ];
+    };
+
     fstrim.enable = true;
 
     # login and unlock with fingerprint (if you add one with `fprintd-enroll`)
diff --git a/nixos/services/xserver.nix b/nixos/services/xserver.nix
index d9bb8a3..1b855f8 100644
--- a/nixos/services/xserver.nix
+++ b/nixos/services/xserver.nix
@@ -4,10 +4,7 @@
 
   # windowManager.dwm = { enable = false; };
 
-  desktopManager.plasma5 = {
-    enable = true;
-    useQtScaling = true;
-  };
+  desktopManager.gnome.enable = true;
 
   displayManager = {
     autoLogin = {
@@ -15,10 +12,7 @@
       user = "u";
     };
 
-    sddm = {
-      enable = true;
-      # timeout = 0;
-    };
+    gdm.enable = true;
   };
 
   videoDrivers = [ "modesetting" ];
diff --git a/nixos/sound/default.nix b/nixos/sound/default.nix
index c2d5f5a..577b2a0 100644
--- a/nixos/sound/default.nix
+++ b/nixos/sound/default.nix
@@ -1,3 +1,3 @@
-{
-  sound.enable = false;
+{ lib, ... }: {
+  sound.enable = lib.mkForce false;
 }

The output of

systemctl status --user pipewire.service
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/etc/systemd/user/pipewire.service; linked-runtime; preset: enabled)
    Drop-In: /nix/store/31h955pwxxicz1ik0qz2ii94hr7c6vsm-user-units/pipewire.service.d
             └─overrides.conf
     Active: active (running) since Mon 2023-11-20 01:54:06 CET; 10min ago
TriggeredBy: ● pipewire.socket
   Main PID: 2245 (pipewire)
      Tasks: 7 (limit: 18849)
     Memory: 9.8M
        CPU: 87ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─2245 /nix/store/z0rrfrsjs3mds7inxkz6pcsqmpflyj1z-pipewire-0.3.80/bin/pipewire

Nov 20 01:54:06 u systemd[1691]: Started PipeWire Multimedia Service.
Nov 20 01:54:09 u pipewire[2245]: ALSA lib conf.c:4556:(snd_config_update_r) Cannot access file /alsa/asoundrc
Nov 20 01:54:09 u pipewire[2245]: ALSA lib seq.c:935:(snd_seq_open_noupdate) Unknown SEQ default
Nov 20 01:54:09 u pipewire[2245]: spa.alsa: open failed: No such file or directory
Nov 20 01:54:09 u pipewire[2245]: [0:00:19.241588412] [2245]  INFO IPAManager ipa_manager.cpp:143 libcamera is not installed. Adding '/nix/store/src/ipa' to the IPA search path
Nov 20 01:54:09 u pipewire[2245]: [0:00:19.241801190] [2245]  INFO Camera camera_manager.cpp:298 libcamera v0.0.5

The log complains about not being able to access ALSA.

I would imagine this is because of disabling it with sound.enable = lib.mkForce false.

It is actually the default (also worked on KDE Plasma) and the Pipewire Wiki says to do so:

# Remove sound.enable or set it to false if you had it set previously, as sound.enable is only meant for ALSA-based configurations

Just for anyone wondering, there seems to have been a misconfiguration of zsh on my part using zsh with home-manager. (Something about zsh config files initialization order and incompatibility with what home-manager zsh module thinks is the correct startup order)

I eventually resolved this issue when reverting to stock zsh.
Thanks everyone