From 57ed52d61f11d01ed1f590ef4d2d9dbc0d740177 Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Tue, 3 Jul 2018 00:40:57 +0200 Subject: [PATCH 1/2] nixos/gpsd-service: add services.gpsd.nowait option --- nixos/modules/services/misc/gpsd.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/services/misc/gpsd.nix b/nixos/modules/services/misc/gpsd.nix index 71de08609073..80f5501ec1d8 100644 --- a/nixos/modules/services/misc/gpsd.nix +++ b/nixos/modules/services/misc/gpsd.nix @@ -53,6 +53,14 @@ in ''; }; + nowait = mkOption { + type = types.bool; + default = false; + description = '' + don't wait for client connects to poll GPS + ''; + }; + port = mkOption { type = types.int; default = 2947; @@ -100,6 +108,7 @@ in ${pkgs.gpsd}/sbin/gpsd -D "${toString cfg.debugLevel}" \ -S "${toString cfg.port}" \ ${if cfg.readonly then "-b" else ""} \ + ${if cfg.nowait then "-n" else ""} \ "${cfg.device}" ''; }; From 32e982448d055ad2f2536f687da92a8017a24f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 3 Jul 2018 13:55:27 +0100 Subject: [PATCH 2/2] gpsd: use optionalString --- nixos/modules/services/misc/gpsd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/misc/gpsd.nix b/nixos/modules/services/misc/gpsd.nix index 80f5501ec1d8..3bfcb636a3c6 100644 --- a/nixos/modules/services/misc/gpsd.nix +++ b/nixos/modules/services/misc/gpsd.nix @@ -107,8 +107,8 @@ in ExecStart = '' ${pkgs.gpsd}/sbin/gpsd -D "${toString cfg.debugLevel}" \ -S "${toString cfg.port}" \ - ${if cfg.readonly then "-b" else ""} \ - ${if cfg.nowait then "-n" else ""} \ + ${optionalString cfg.readonly "-b"} \ + ${optionalString cfg.nowait "-n"} \ "${cfg.device}" ''; };