treefmt / nix fmt (pull_request) Successful in 6s
pytest / pytest (pull_request) Successful in 33s
test ebook search / test-ebook-search (pull_request) Successful in 38s
build_systems / build-bob (pull_request) Successful in 57s
build_systems / build-rhapsody-in-green (pull_request) Successful in 1m6s
build_systems / build-brain (pull_request) Successful in 1m47s
build_systems / build-jeeves (pull_request) Successful in 2m27s
Add a Rust implementation with privacy-masked locations, HTTP retries, and Home Assistant sensor publishing. Package it with Nix and switch the systemd service from Python to the compiled binary.
33 lines
742 B
Nix
33 lines
742 B
Nix
{
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
van-weather = pkgs.callPackage ../../../rust/van_weather/package.nix { };
|
|
in
|
|
{
|
|
systemd.services.van-weather = {
|
|
description = "Van Weather Service";
|
|
after = [
|
|
"network.target"
|
|
"home-assistant.service"
|
|
];
|
|
requires = [ "home-assistant.service" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${van-weather}/bin/van-weather";
|
|
EnvironmentFile = "/etc/van_weather.env";
|
|
Restart = "on-failure";
|
|
RestartSec = "5s";
|
|
StandardOutput = "journal";
|
|
StandardError = "journal";
|
|
NoNewPrivileges = true;
|
|
ProtectSystem = "strict";
|
|
ProtectHome = "read-only";
|
|
PrivateTmp = true;
|
|
};
|
|
};
|
|
}
|