-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevenv.nix
More file actions
50 lines (41 loc) · 1.21 KB
/
Copy pathdevenv.nix
File metadata and controls
50 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ pkgs, inputs, ... }:
{
imports = [ inputs.scottylabs.devenvModules.default ];
scottylabs.enable = true;
scripts.grafana-dev.exec = ''
exec ${pkgs.grafana}/bin/grafana server \
--homepath ${pkgs.grafana}/share/grafana \
--config "$DEVENV_ROOT/.devenv/grafana.ini"
'';
enterShell = ''
mkdir -p "$DEVENV_ROOT/.devenv/grafana-data"
cat > "$DEVENV_ROOT/.devenv/grafana.ini" <<EOF
[paths]
data = $DEVENV_ROOT/.devenv/grafana-data
provisioning = $DEVENV_ROOT/.devenv/provisioning
[server]
http_addr = 127.0.0.1
http_port = 3000
[auth.anonymous]
enabled = true
org_role = Admin
[security]
disable_initial_admin_creation = true
[dashboards]
default_home_dashboard_path =
EOF
mkdir -p "$DEVENV_ROOT/.devenv/provisioning/dashboards" "$DEVENV_ROOT/.devenv/provisioning/datasources"
cat > "$DEVENV_ROOT/.devenv/provisioning/dashboards/scottylabs.yaml" <<EOF
apiVersion: 1
providers:
- name: scottylabs
folder: ""
type: file
allowUiUpdates: false
disableDeletion: true
options:
path: $DEVENV_ROOT/dashboards
foldersFromFilesStructure: true
EOF
'';
}