nixos/tests/grafana: replace activationScript with tmpfiles
This commit is contained in:
parent
0b294fe2e8
commit
da274a11d7
1 changed files with 8 additions and 9 deletions
|
@ -22,15 +22,14 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
system.activationScripts.setup-grafana = {
|
||||
deps = [ "users" ];
|
||||
text = ''
|
||||
mkdir -p /var/lib/grafana/dashboards
|
||||
chown -R grafana:grafana /var/lib/grafana
|
||||
chmod 0700 -R /var/lib/grafana/dashboards
|
||||
cp ${pkgs.writeText "test.json" (builtins.readFile ./test_dashboard.json)} /var/lib/grafana/dashboards/
|
||||
'';
|
||||
};
|
||||
systemd.tmpfiles.rules =
|
||||
let
|
||||
dashboard = pkgs.writeText "test.json" (builtins.readFile ./test_dashboard.json);
|
||||
in
|
||||
[
|
||||
"d /var/lib/grafana/dashboards 0700 grafana grafana -"
|
||||
"C+ /var/lib/grafana/dashboards/test.json - - - - ${dashboard}"
|
||||
];
|
||||
};
|
||||
|
||||
extraNodeConfs = {
|
||||
|
|
Loading…
Reference in a new issue