nixos/gpsd-service: change from deprecated 'jobs' type to 'systemd'
This has the nice side-effect of making gpsd actually run! Old behaviour (debugLevel=2): systemd[1]: gpsd.service holdoff time over, scheduling restart. systemd[1]: Stopping GPSD daemon... systemd[1]: Starting GPSD daemon... systemd[1]: gpsd.service start request repeated too quickly, refusing to start. systemd[1]: Failed to start GPSD daemon. systemd[1]: Unit gpsd.service entered failed state. New behaviour (debugLevel=2): gpsd[945]: gpsd: launching (Version 2.95) systemd[1]: Started GPSD daemon. gpsd[945]: gpsd: listening on port 2947 gpsd[945]: gpsd: running with effective group ID 27 gpsd[945]: gpsd: running with effective user ID 23 gpsd[945]: gpsd: stashing device /dev/ttyUSB0 at slot 0
This commit is contained in:
parent
da184a455f
commit
28e5f72f05
|
@ -85,19 +85,20 @@ in
|
||||||
inherit gid;
|
inherit gid;
|
||||||
};
|
};
|
||||||
|
|
||||||
jobs.gpsd =
|
systemd.services.gpsd = {
|
||||||
{ description = "GPSD daemon";
|
description = "GPSD daemon";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
startOn = "ip-up";
|
after = [ "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
exec =
|
Type = "forking";
|
||||||
''
|
ExecStart = ''
|
||||||
${pkgs.gpsd}/sbin/gpsd -D "${toString cfg.debugLevel}" \
|
${pkgs.gpsd}/sbin/gpsd -D "${toString cfg.debugLevel}" \
|
||||||
-S "${toString cfg.port}" \
|
-S "${toString cfg.port}" \
|
||||||
${if cfg.readonly then "-b" else ""} \
|
${if cfg.readonly then "-b" else ""} \
|
||||||
"${cfg.device}"
|
"${cfg.device}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user