Compare commits

...

2 commits

Author SHA1 Message Date
11618adc76
Enable garmin-grafana on sisko
Some checks failed
/ test (push) Failing after 14m31s
2025-04-30 21:20:56 +02:00
4290a4d45a
Add garmin-grafana module 2025-04-30 21:20:31 +02:00
2 changed files with 54 additions and 0 deletions

View file

@ -35,6 +35,7 @@
"mosh"
"amule"
"adguard-home"
"garmin-grafana"
]
++ [
./disko.nix

View file

@ -0,0 +1,53 @@
{
config,
pkgs,
lib,
...
}:
let
garmin-grafana-flake = builtins.getFlake "github:NixOS/nixpkgs/1f03fefb44665cd2377912033de22ffaba2be48d";
inherit (garmin-grafana-flake.legacyPackages.${pkgs.system}) garmin-grafana;
in
{
users.users.garmin-grafana = {
isSystemUser = true;
group = "garmin-grafana";
extraGroups = [ "garmin-grafana" ];
home = "/var/lib/garmin-grafana";
};
users.groups.garmin-grafana = { };
systemd.services.garmin-grafana = {
description = "garmin-grafana";
wantedBy = [ "multi-user.target" ];
environment = {
INFLUXDB_HOST = "localhost";
INFLUXDB_PORT = "8086"; # it's hardcoded in the influxdb NixOS module
INFLUXDB_USERNAME = "garmin-grafana";
INFLUXDB_PASSWORD = "password"; # FIXME terrible but the databse is not exposed at least
INFLUXDB_DATABASE = "garmin-stats";
GARMINCONNECT_IS_CN = "False";
USER_TIMEZONE = "Europe/Rome";
KEEP_FIT_FILES = "True";
ALWAYS_PROCESS_FIT_FILES = "True";
# MANUAL_START_DATE = "2024-06-01";
# MANUAL_END_DATE = "2025-12-31";
};
serviceConfig = {
ExecStart = lib.getExe garmin-grafana;
Group = "garmin-grafana";
User = "garmin-grafana";
WorkingDirectory = "/var/lib/garmin-grafana";
};
};
# garmin-grafana uses influxdb V1, probably it's the only software I'll ever use using the V1
# so I"m keeping its declaration inside this module
services.influxdb.enable = true;
environment.persistence."/persist".directories = [
"/var/lib/garmin-grafana"
config.services.influxdb.dataDir
];
}