diff --git a/nixos/hosts/trailblazer/default.nix b/nixos/hosts/trailblazer/default.nix index b6d4ec7..49d4140 100644 --- a/nixos/hosts/trailblazer/default.nix +++ b/nixos/hosts/trailblazer/default.nix @@ -221,6 +221,20 @@ in script = "${commandScript}/bin/trailblazer-command-daemon"; }; + # + # Let trailblazer share its GPS with the house devices. + # + systemd.services.gps-share = { + description = "share our GPS with our other devices on the LAN"; + + # Start once we're online. + wantedBy = [ "default.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + + script = "${deprekages.gps-share}/bin/gps-share /dev/ttyACM0"; + }; + # # Hardware config. # diff --git a/packages/default.nix b/packages/default.nix index 506b491..f0d01cc 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -95,6 +95,7 @@ flake-utils.lib.eachDefaultSystem ( # hw support dell = callPackage ./dell { }; synatudor = callPackage ./synatudor { }; + gps-share = callPackage ./gps-share.nix { }; # udev rules~ t5-udev-rules = callPackage ./t5-udev-rules { }; diff --git a/packages/gps-share.nix b/packages/gps-share.nix new file mode 100644 index 0000000..40115ad --- /dev/null +++ b/packages/gps-share.nix @@ -0,0 +1,29 @@ +# +# Wayland-satellite Xwayland implementation. +# +# vim: et:ts=2:sw=2: +{ + rustPlatform, + fetchFromGitHub, + udev, + pkg-config, +}: +rustPlatform.buildRustPackage rec { + pname = "gps-share"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "zeenix"; + repo = pname; + rev = "${version}"; + hash = "sha256-Rh7Pt9JN30TyuxwHOn8dwZrUfmkknUhOGonbhROpGxA="; + }; + + cargoHash = "sha256-WhYHFaSZfnlEmlXFLj7BIt0agMFuz07LcAXJ9ZOOrvY="; + + buildInputs = [ udev ]; + nativeBuildInputs = [ pkg-config ]; + + # Checks require a live device, so we'll skip them. + doCheck = false; +}