gpsd: deploy via sane.programs interface

This commit is contained in:
Colin 2024-06-20 11:57:09 +00:00
parent 78d66a8b09
commit fe57f186cd
4 changed files with 19 additions and 9 deletions

View File

@ -40,10 +40,6 @@
{ config, lib, ... }:
{
# test gpsd with `gpspipe -w -n 10 2> /dev/null | grep -m 1 TPV | jq '.lat, .lon' | tr '\n' ' '`
# ^ should return <lat> <long>
services.gpsd.enable = true;
services.gpsd.devices = [ "/dev/ttyUSB1" ];
users.users.geoclue.extraGroups = [
"dialout" # TODO: figure out if dialout is required. that's for /dev/ttyUSB1, but geoclue probably doesn't read that?

View File

@ -63,6 +63,7 @@
./gnome-weather.nix
./go2tv.nix
./gpodder.nix
./gpsd.nix
./grimshot.nix
./gst-device-monitor.nix
./gthumb.nix

View File

@ -0,0 +1,15 @@
# test gpsd with `gpspipe -w -n 10 2> /dev/null | grep -m 1 TPV | jq '.lat, .lon' | tr '\n' ' '`
# ^ should return <lat> <long>
#
# TODO(2024/06/19): nixpkgs' gpsd service isn't sandboxed at ALL. i should sandbox that, or remove this integration.
{ config, lib, ... }:
let
cfg = config.sane.programs.gpsd;
in
{
sane.programs.gpsd = {};
services.gpsd = lib.mkIf cfg.enabled {
enable = true;
devices = [ "/dev/ttyUSB1" ];
};
}

View File

@ -16,13 +16,11 @@
{ type = "file"; path = ".cache/mepo/savestate"; }
];
# enable geoclue2 integration,
# and give mepo access to gpsd for location data, if that's enabled.
# TODO: this gpsd stuff should be moved to its own file!
# enable geoclue2 and gpsd for location data.
suggestedPrograms = [
"geoclue2"
] ++ lib.optional config.services.gpsd.enable "gpsd"
;
"gpsd"
];
};
# programs.mepo = lib.mkIf config.sane.programs.mepo.enabled {