diff options
author | Felix Buehler <account@buehler.rocks> | 2024-01-26 23:10:57 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2024-01-26 23:10:57 +0100 |
commit | bdce5312c9458eff44132647867dd55397ba09b1 (patch) | |
tree | 6d96a5a14d9e4c368c3ce12df48d6482f4415603 /nixos/modules/services/monitoring | |
parent | 1aa4e31045559f9edf650503363fd5390e1066be (diff) | |
download | nixlib-bdce5312c9458eff44132647867dd55397ba09b1.tar nixlib-bdce5312c9458eff44132647867dd55397ba09b1.tar.gz nixlib-bdce5312c9458eff44132647867dd55397ba09b1.tar.bz2 nixlib-bdce5312c9458eff44132647867dd55397ba09b1.tar.lz nixlib-bdce5312c9458eff44132647867dd55397ba09b1.tar.xz nixlib-bdce5312c9458eff44132647867dd55397ba09b1.tar.zst nixlib-bdce5312c9458eff44132647867dd55397ba09b1.zip |
nixos/{zabbixServer,zabbixProxy}: prefer 'install' over 'mkdir/chmod/chown'
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r-- | nixos/modules/services/monitoring/zabbix-proxy.nix | 5 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/zabbix-server.nix | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixos/modules/services/monitoring/zabbix-proxy.nix index 503e81b48a58..fea5704af6f6 100644 --- a/nixos/modules/services/monitoring/zabbix-proxy.nix +++ b/nixos/modules/services/monitoring/zabbix-proxy.nix @@ -299,10 +299,7 @@ in fi '' + optionalString (cfg.database.passwordFile != null) '' # create a copy of the supplied password file in a format zabbix can consume - touch ${passwordFile} - chmod 0600 ${passwordFile} - echo -n "DBPassword = " > ${passwordFile} - cat ${cfg.database.passwordFile} >> ${passwordFile} + install -m 0600 <(echo "DBPassword = $(cat ${cfg.database.passwordFile})") ${passwordFile} ''; serviceConfig = { diff --git a/nixos/modules/services/monitoring/zabbix-server.nix b/nixos/modules/services/monitoring/zabbix-server.nix index 0607188d2131..f2fb5fbe7ac6 100644 --- a/nixos/modules/services/monitoring/zabbix-server.nix +++ b/nixos/modules/services/monitoring/zabbix-server.nix @@ -292,10 +292,7 @@ in fi '' + optionalString (cfg.database.passwordFile != null) '' # create a copy of the supplied password file in a format zabbix can consume - touch ${passwordFile} - chmod 0600 ${passwordFile} - echo -n "DBPassword = " > ${passwordFile} - cat ${cfg.database.passwordFile} >> ${passwordFile} + install -m 0600 <(echo "DBPassword = $(cat ${cfg.database.passwordFile})") ${passwordFile} ''; serviceConfig = { |