Surface-Book 3 External Monitor through dockingstation - no image

Hello everyone.

I have NixOS 23.11 installed on my Microsoft Surface Book 3.
I am using gnome and hyprland.
It works well, except that I can’t get my second monitor to show my desktop when connected via docking-station. It is connected, according to hyprctl and xrandr, but the monitor itself says “No video input”.

The monitor is connected to the station via HDMI, the station to the laptop via USB-C.
Mouse and keyboard that are connected to the station work.

The monitor does show my desktop when I plug it into an adapter and then to the laptop via usb-c.
But not via dockingstation.

I think I have by now gone through most pages in which people discuss similar topics, so my nix-config is a little all over the place now, but essentially I have mostly been messing around with

services.xserver.videoDrivers
and hardware.nvidia settings.

My laptop has an nvidia gtx1660ti graphics card.

The system does actually seem to recognize when the monitor is connected, because when it is I can drag windows out of my laptop screen (to another workspace). Can’t do that otherwise.

Also hyprctl monitors outputs this when connected via dockingstation:

(ignoring laptop monitor, this is the second one)

Monitor DP-5 (ID 1):
	3440x1440@59.97300 at 2160x0
	description: Philips Consumer Electronics Company PHL 345B1C 0x0000B72A (DP-5)
	make: Philips Consumer Electronics Company
	model: PHL 345B1C
	serial: 0x0000B72A
	active workspace: 4 (4)
	special workspace: 0 ()
	reserved: 0 42 0 0
	scale: 1.00
	transform: 0
	focused: no
	dpmsStatus: 1
	vrr: 0
	activelyTearing: false

and this when connected via hdmi directly:

Monitor DP-1 (ID 1):
	3440x1440@29.98500 at 2160x0
	description: Philips Consumer Electronics Company PHL 345B1C 0x0000B72A (DP-1 via HDMI)
	make: Philips Consumer Electronics Company
	model: PHL 345B1C
	serial: 0x0000B72A
	active workspace: 6 (6)
	special workspace: 0 ()
	reserved: 0 42 0 0
	scale: 1.00
	transform: 0
	focused: no
	dpmsStatus: 1
	vrr: 0
	activelyTearing: false

The noteworthy difference to me is that in the second case it tells me that it’s a hdmi connection.
I did take the DP-1 vs DP-5 difference into account when configuring my monitor layout in the hyprland config.

my current nix config (without user-settings and application-packages to keep it shorter - the graphics-stuff is at the bottom):

{ config, pkgs, ... }:
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];
  environment.sessionVariables = { GTK_THEME = "Adwaita:dark"; }; 
  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  services.devmon.enable = true;
  services.gvfs.enable = true;
  services.udisks2.enable = true;
  boot.supportedFilesystems = [ "ntfs" ];

  networking.hostName = "nixos"; # Define your hostname.

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Berlin";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_GB.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "de_DE.UTF-8";
    LC_IDENTIFICATION = "de_DE.UTF-8";
    LC_MEASUREMENT = "de_DE.UTF-8";
    LC_MONETARY = "de_DE.UTF-8";
    LC_NAME = "de_DE.UTF-8";
    LC_NUMERIC = "de_DE.UTF-8";
    LC_PAPER = "de_DE.UTF-8";
    LC_TELEPHONE = "de_DE.UTF-8";
    LC_TIME = "de_DE.UTF-8";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = false;

  # Configure keymap in X11
  services.xserver = {
    layout = "de";
    xkbVariant = "";
  };

  # Configure console keymap
  console.keyMap = "de";

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  };

  nixpkgs.config.allowUnfree = true;

system.stateVersion = "23.11"; # Did you read the comment? 

programs.hyprland = {    
    enable = true;    
    xwayland.enable = true;    
    enableNvidiaPatches = true; 
};

programs.waybar = {
   enable = true;
};

 services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];


nixpkgs.config.permittedInsecurePackages = [
	"electron-25.9.0"
];

security.pam.services.gtklock = {};

services.xserver.desktopManager.gnome.extraGSettingsOverrides = ''
	[org.gnome.desktop.interface]
	gtk-theme='Arc-Dark'
'';
hardware.opengl.enable = true;
nixpkgs.config.nvidia.acceptLicense = true;
services.xserver.displayManager.gdm.wayland = true; 
#services.xserver.videoDrivers = [ "nouveau" ];
#services.xserver.videoDrivers = [ "displaylink" "modesetting" ];
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
	modesetting.enable = true;
	powerManagement.enable = false;
	open = false;
	nvidiaSettings = true;
	package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# i tried the following, but lspci | grep VGA returns nothing
#hardware.nvidia.prime = {
#    sync.enable = true;
#    nvidiaBusId = "PCI:01:00:0";   # Found with lspci | grep VGA
#    intelBusId = "PCI:00:02:0";   # Found with lspci | grep VGA
#  };

}



I have gone through the following pages (and more that I don’t remember) as I’ve tried out solutions:

I am still very new to nixos and somewhat new to linux, so apologies if I am not giving all relevant information right away.

Thank you.

UPDATE: After literally just sitting there for 20 minutes completely black, the screen showed my desktop for a few seconds and then went black again.
I know however that it is not a cable-related issue, since the same setup works fine and reliably with a windows laptop.