diff --git a/pkgs/by-name/ga/garmin-grafana/package.nix b/pkgs/by-name/ga/garmin-grafana/package.nix new file mode 100644 index 000000000000..262c1adaf30e --- /dev/null +++ b/pkgs/by-name/ga/garmin-grafana/package.nix @@ -0,0 +1,54 @@ +{ + fetchFromGitHub, + python3Packages, + lib, +}: +python3Packages.buildPythonPackage rec { + pname = "garmin-grafana"; + version = "0.3.0"; + + pyproject = true; + + src = fetchFromGitHub { + owner = "arpanghosh8453"; + repo = "garmin-grafana"; + tag = "v${version}"; + hash = "sha256-nuVT6LK9KIs/FwUbdfI4xpKru4jfAyj1/vmk7ji43zk="; + }; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ + fitparse + garminconnect + influxdb + influxdb3-python + python-dotenv + ]; + + doCheck = false; # there are no tests + + dontCheckRuntimeDeps = true; + + postInstall = '' + install -Dt $out/share/grafana-dashboards -m644 Grafana_Dashboard/Garmin-Grafana-Dashboard.json + ''; + + passthru.grafana-dashboard = "${placeholder "out"}/share/grafana-dashboards/Garmin-Grafana-Dashboard.json"; + + meta = { + description = "Export Garmin data to InfluxDB"; + longDescription = '' + A Python script to fetch Garmin health data and populate that in an InfluxDB database, + for visualizing long-term health trends with Grafana + ''; + homepage = "https://github.com/arpanghosh8453/garmin-grafana"; + changelog = "https://github.com/arpanghosh8453/garmin-grafana/releases/tag/v${version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ aciceri ]; + mainProgram = "garmin-fetch"; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/development/python-modules/fitparse/default.nix b/pkgs/development/python-modules/fitparse/default.nix new file mode 100644 index 000000000000..7caf8d2b866d --- /dev/null +++ b/pkgs/development/python-modules/fitparse/default.nix @@ -0,0 +1,40 @@ +{ + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + lib, + setuptools, +}: +buildPythonPackage rec { + pname = "fitparse"; + version = "1.2.0"; + + pyproject = true; + build-system = [ setuptools ]; + + src = fetchFromGitHub { + owner = "dtcooper"; + repo = "python-fitparse"; + tag = "v${version}"; + hash = "sha256-aO4djG9omc0jogalLitvT5i58cYKXqtvJ5WGBiCv448="; + }; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + "test_utils" + ]; + + pythonImportsCheck = [ + "fitparse" + ]; + + meta = { + description = "Python library to parse ANT/Garmin .FIT files"; + homepage = "https://pythonhosted.org/fitparse/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aciceri ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb44f2fd32d3..96307322c633 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5396,6 +5396,8 @@ self: super: with self; { fitfile = callPackage ../development/python-modules/fitfile { }; + fitparse = callPackage ../development/python-modules/fitparse { }; + fivem-api = callPackage ../development/python-modules/fivem-api { }; fixerio = callPackage ../development/python-modules/fixerio { };