forked from the-distro/infra
feat(grafana): jsonnet-based dashboards
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
aef541829e
commit
d1ffce9336
21
dashboards/default.nix
Normal file
21
dashboards/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ stdenv, jsonnet, fetchFromGitHub, lib, ... }:
|
||||
rec {
|
||||
grafonnet = fetchFromGitHub {
|
||||
owner = "grafana";
|
||||
repo = "grafonnet-lib";
|
||||
# TODO: figure out how to read the jsonnet lockfile
|
||||
# and propagate this a bit cleverly.
|
||||
rev = "a1d61cce1da59c71409b99b5c7568511fec661ea";
|
||||
hash = "sha256-fs5JZJbcL6sQXBjYhp5eeRtjTFw0J1O/BcwBC8Vm9EM=";
|
||||
};
|
||||
buildJsonnetDashboards = dashboardSrc: target: stdenv.mkDerivation {
|
||||
name = "jsonnet-grafana-dashboard-${baseNameOf target}";
|
||||
src = dashboardSrc;
|
||||
buildInputs = [ jsonnet ];
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
jsonnet -J ${grafonnet} --ext-code publish=false ${target} > $out
|
||||
runHook postBuild
|
||||
'';
|
||||
};
|
||||
}
|
17
flake.lock
17
flake.lock
|
@ -385,6 +385,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gerrit-dashboard": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1724491526,
|
||||
"narHash": "sha256-iBI8Rkcv3CYdZHz5hDI0104C+DgPZRh5K6Zcqz9iUWw=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "d6badc64723b888a4cfa0cf966aec8b91dcb8a2b",
|
||||
"revCount": 74,
|
||||
"type": "git",
|
||||
"url": "https://git.lix.systems/the-distro/gerrit-monitoring.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lix.systems/the-distro/gerrit-monitoring.git"
|
||||
}
|
||||
},
|
||||
"grapevine": {
|
||||
"inputs": {
|
||||
"attic": "attic",
|
||||
|
@ -669,6 +685,7 @@
|
|||
"agenix": "agenix",
|
||||
"buildbot-nix": "buildbot-nix",
|
||||
"colmena": "colmena",
|
||||
"gerrit-dashboard": "gerrit-dashboard",
|
||||
"grapevine": "grapevine",
|
||||
"hydra": "hydra",
|
||||
"lix": [
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
nix-gerrit.url = "git+https://git.lix.systems/the-distro/nix-gerrit.git";
|
||||
nix-gerrit.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
gerrit-dashboard.url = "git+https://git.lix.systems/the-distro/gerrit-monitoring.git";
|
||||
gerrit-dashboard.flake = false;
|
||||
|
||||
buildbot-nix.url = "git+https://git.lix.systems/lix-project/buildbot-nix.git?ref=refs/heads/non-flakes";
|
||||
buildbot-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
|
|
Loading…
Reference in a new issue