aboutsummaryrefslogtreecommitdiff
path: root/modules/private/monitoring
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-10-16 17:40:07 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-10-16 20:20:45 +0200
commit4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0 (patch)
tree9a7ede9ac3f1899074e9ef568a447f883191d3b5 /modules/private/monitoring
parentda30ae4ffdd153a1eb32fb86f9ca9a65aa19e4e2 (diff)
downloadNix-4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0.tar.gz
Nix-4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0.tar.zst
Nix-4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0.zip
Use attrs for secrets instead of lists
Diffstat (limited to 'modules/private/monitoring')
-rw-r--r--modules/private/monitoring/default.nix13
-rw-r--r--modules/private/monitoring/status.nix19
-rw-r--r--modules/private/monitoring/status_engine.nix5
3 files changed, 15 insertions, 22 deletions
diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix
index cab9e7c..bdb5c93 100644
--- a/modules/private/monitoring/default.nix
+++ b/modules/private/monitoring/default.nix
@@ -199,18 +199,15 @@ in
199 text = "MAILADDR ${config.myEnv.monitoring.email}"; 199 text = "MAILADDR ${config.myEnv.monitoring.email}";
200 }; 200 };
201 201
202 secrets.keys = [ 202 secrets.keys = {
203 { 203 "naemon/id_rsa" = {
204 dest = "naemon/id_rsa";
205 user = "naemon"; 204 user = "naemon";
206 group = "naemon"; 205 group = "naemon";
207 permissions = "0400"; 206 permissions = "0400";
208 text = config.myEnv.monitoring.ssh_secret_key; 207 text = config.myEnv.monitoring.ssh_secret_key;
209 } 208 };
210 ] ++ lib.optionals cfg.master ( 209 } // lib.optionalAttrs cfg.master (
211 lib.mapAttrsToList (k: v: 210 lib.mapAttrs' (k: v: lib.nameValuePair "${k}_access_key" {
212 {
213 dest = "${k}_access_key";
214 user = "naemon"; 211 user = "naemon";
215 group = "naemon"; 212 group = "naemon";
216 permissions = "0400"; 213 permissions = "0400";
diff --git a/modules/private/monitoring/status.nix b/modules/private/monitoring/status.nix
index 73f4749..ab0290c 100644
--- a/modules/private/monitoring/status.nix
+++ b/modules/private/monitoring/status.nix
@@ -12,17 +12,14 @@
12 }; 12 };
13 }; 13 };
14 config = lib.mkIf config.myServices.status.enable { 14 config = lib.mkIf config.myServices.status.enable {
15 secrets.keys = [ 15 secrets.keys."naemon-status/environment" = {
16 { 16 user = "naemon";
17 dest = "naemon-status/environment"; 17 group = "naemon";
18 user = "naemon"; 18 permissions = "0400";
19 group = "naemon"; 19 text = ''
20 permission = "0400"; 20 TOKENS=${builtins.concatStringsSep " " config.myEnv.monitoring.nrdp_tokens}
21 text = '' 21 '';
22 TOKENS=${builtins.concatStringsSep " " config.myEnv.monitoring.nrdp_tokens} 22 };
23 '';
24 }
25 ];
26 services.nginx = { 23 services.nginx = {
27 enable = true; 24 enable = true;
28 recommendedOptimisation = true; 25 recommendedOptimisation = true;
diff --git a/modules/private/monitoring/status_engine.nix b/modules/private/monitoring/status_engine.nix
index 8192a9d..39a753a 100644
--- a/modules/private/monitoring/status_engine.nix
+++ b/modules/private/monitoring/status_engine.nix
@@ -19,8 +19,7 @@ in
19 }; 19 };
20 }; 20 };
21 21
22 secrets.keys = [{ 22 secrets.keys."status_engine" = {
23 dest = "status_engine";
24 permissions = "0400"; 23 permissions = "0400";
25 user = "naemon"; 24 user = "naemon";
26 group = "naemon"; 25 group = "naemon";
@@ -87,7 +86,7 @@ in
87 86
88 disable_http_proxy: 1 87 disable_http_proxy: 1
89 ''; 88 '';
90 }]; 89 };
91 90
92 services.redis = rec { 91 services.redis = rec {
93 enable = true; 92 enable = true;