mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	inspiron-5515: fix race for fix-touchpad.sh
On rare occasions, the module would be removed before suspend and the touchpad would be disabled on boot.
This commit is contained in:
		@@ -12,13 +12,18 @@
 | 
			
		||||
  # hack around it by unloading and reloading module i2c_hid
 | 
			
		||||
  systemd.services.fix-touchpad = {
 | 
			
		||||
    path = [ pkgs.kmod ];
 | 
			
		||||
    serviceConfig.ExecStart = "${./fix_touchpad.sh}";
 | 
			
		||||
    serviceConfig.ExecStart = ''${pkgs.systemd}/bin/systemd-inhibit --what=sleep --why="fixing touchpad must finish before sleep" --mode=delay  ${./fix_touchpad.sh}'';
 | 
			
		||||
    serviceConfig.Type = "oneshot";
 | 
			
		||||
    description = "reload touchpad driver";
 | 
			
		||||
    # must run at boot (and not too early), and after suspend
 | 
			
		||||
    wantedBy = [ "display-manager.service" "sleep.target" ];
 | 
			
		||||
    after = [ "sleep.target" ];
 | 
			
		||||
    wantedBy = [ "display-manager.service" "post-resume.target" ];
 | 
			
		||||
    # prevent running before suspend
 | 
			
		||||
    after = [ "post-resume.target" ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # so that post-resume.service exists
 | 
			
		||||
  powerManagement.enable = true;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  # fix suspend
 | 
			
		||||
  # https://bbs.archlinux.org/viewtopic.php?id=266108 says linux >= 5.12 required
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user