diff options
author | Martin Fischer <martin@push-f.com> | 2025-08-27 21:19:14 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-08-28 20:59:59 +0200 |
commit | 647360dd67bacc00b7c280743a4834206aec89f1 (patch) | |
tree | e9f9c64e7bae18f1b0c0b49da9f48e669efe77b1 /nixos/shared/grafana-matrix-forwarder | |
parent | 613346ff97f9c3ac2e9026613aa4b183a06917a2 (diff) |
tente: replace gotify with grafana-matrix-forwarder
Diffstat (limited to 'nixos/shared/grafana-matrix-forwarder')
-rw-r--r-- | nixos/shared/grafana-matrix-forwarder/default.nix | 10 | ||||
-rw-r--r-- | nixos/shared/grafana-matrix-forwarder/service.nix | 31 |
2 files changed, 41 insertions, 0 deletions
diff --git a/nixos/shared/grafana-matrix-forwarder/default.nix b/nixos/shared/grafana-matrix-forwarder/default.nix new file mode 100644 index 0000000..7a04dcb --- /dev/null +++ b/nixos/shared/grafana-matrix-forwarder/default.nix @@ -0,0 +1,10 @@ +{ buildGoModule }: +let + sources = import <top/npins>; +in +buildGoModule { + pname = "grafana-matrix-forwarder"; + version = sources.grafana-matrix-forwarder.version; + src = sources.grafana-matrix-forwarder; + vendorHash = "sha256-ifkeakyRkIF2Y/4otUWhTvUzsPwRb1Wxx6gqN0806c4="; +} diff --git a/nixos/shared/grafana-matrix-forwarder/service.nix b/nixos/shared/grafana-matrix-forwarder/service.nix new file mode 100644 index 0000000..5ad511c --- /dev/null +++ b/nixos/shared/grafana-matrix-forwarder/service.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +let + grafanaMatrixForwarder = pkgs.callPackage ./default.nix {}; + cfg = config.services.grafana-matrix-forwarder; +in +{ + options.services.grafana-matrix-forwarder = { + enable = lib.mkEnableOption "grafana-matrix-forwarder"; + port = lib.mkOption { + type = lib.types.int; + }; + homeserver = lib.mkOption { + type = lib.types.str; + }; + environmentFile = lib.mkOption { + type = lib.types.path; + }; + }; + + config = lib.mkIf cfg.enable { + systemd.services.grafana-matrix-forwarder = { + serviceConfig = { + ExecStart = "${grafanaMatrixForwarder}/bin/grafana-matrix-forwarder --port=${toString cfg.port} --homeserver ${cfg.homeserver}"; + EnvironmentFile = cfg.environmentFile; + DynamicUser = "true"; + }; + wantedBy = ["multi-user.target"]; + }; + }; +} |