diff --git a/nixos/modules/services/ttys/gpm.nix b/nixos/modules/services/ttys/gpm.nix index 12fe4e2f84f1..eda062494288 100644 --- a/nixos/modules/services/ttys/gpm.nix +++ b/nixos/modules/services/ttys/gpm.nix @@ -40,12 +40,15 @@ in config = mkIf cfg.enable { - jobs.gpm = - { description = "General purpose mouse"; + systemd.services.gpm = + { description = "Console Mouse Daemon"; - startOn = "started udev"; + wantedBy = [ "multi-user.target" ]; + after = [ "systemd-udev-settle.service" ]; - exec = "${pkgs.gpm}/sbin/gpm -m /dev/input/mice -t ${cfg.protocol} -D &>/dev/null"; + serviceConfig.ExecStart = "@${pkgs.gpm}/sbin/gpm gpm -m /dev/input/mice -t ${cfg.protocol}"; + serviceConfig.Type = "forking"; + serviceConfig.PIDFile = "/run/gpm.pid"; }; };