about summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2023-10-06 22:54:51 +0800
committerGitHub <noreply@github.com>2023-10-06 22:54:51 +0800
commitde26e61f7e0520918a3ee834f7151703676dc37f (patch)
tree16460c086d89fbf7152717a42908e87b88734d43 /nixos/modules/services
parent806415e367f6289346361f640fac6d474ada913a (diff)
parent342cc761dfd76ac6caaaafd96b3aac8f0311119a (diff)
downloadnixlib-de26e61f7e0520918a3ee834f7151703676dc37f.tar
nixlib-de26e61f7e0520918a3ee834f7151703676dc37f.tar.gz
nixlib-de26e61f7e0520918a3ee834f7151703676dc37f.tar.bz2
nixlib-de26e61f7e0520918a3ee834f7151703676dc37f.tar.lz
nixlib-de26e61f7e0520918a3ee834f7151703676dc37f.tar.xz
nixlib-de26e61f7e0520918a3ee834f7151703676dc37f.tar.zst
nixlib-de26e61f7e0520918a3ee834f7151703676dc37f.zip
Merge pull request #258582 from returntoreality/gpsd-extra-args
nixos/gpsd: add extraArgs option
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/misc/gpsd.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gpsd.nix b/nixos/modules/services/misc/gpsd.nix
index ce0f9bb3ba28..5d2e806181df 100644
--- a/nixos/modules/services/misc/gpsd.nix
+++ b/nixos/modules/services/misc/gpsd.nix
@@ -92,6 +92,16 @@ in {
         '';
       };
 
+      extraArgs = mkOption {
+        type = types.listOf types.str;
+        default = [ ];
+        example = [ "-r" "-s" "19200" ];
+        description = lib.mdDoc ''
+          A list of extra command line arguments to pass to gpsd.
+          Check gpsd(8) mangpage for possible arguments.
+        '';
+      };
+
     };
 
   };
@@ -117,12 +127,14 @@ in {
         Type = "forking";
         ExecStart = let
           devices = utils.escapeSystemdExecArgs cfg.devices;
+          extraArgs = utils.escapeSystemdExecArgs cfg.extraArgs;
         in ''
           ${pkgs.gpsd}/sbin/gpsd -D "${toString cfg.debugLevel}"  \
             -S "${toString cfg.port}"                             \
             ${optionalString cfg.readonly "-b"}                   \
             ${optionalString cfg.nowait "-n"}                     \
             ${optionalString cfg.listenany "-G"}                  \
+            ${extraArgs}                                          \
             ${devices}
         '';
       };