diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2017-04-11 18:08:51 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2017-04-11 18:18:53 +0200 |
commit | 3ab45f4b369c9c741b55ddedeaac4c797dc61c04 (patch) | |
tree | 3c5e330622e42066e50ab20a6c58b9251addf863 /nixos/modules/services/monitoring | |
parent | 54fff9ec1a9e7425926eadffada0268351536926 (diff) | |
download | nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.tar nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.tar.gz nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.tar.bz2 nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.tar.lz nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.tar.xz nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.tar.zst nixlib-3ab45f4b369c9c741b55ddedeaac4c797dc61c04.zip |
treewide: use boolToString function
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r-- | nixos/modules/services/monitoring/collectd.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/grafana.nix | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/nixos/modules/services/monitoring/collectd.nix b/nixos/modules/services/monitoring/collectd.nix index 641da60e9adc..79a8a1ff5aed 100644 --- a/nixos/modules/services/monitoring/collectd.nix +++ b/nixos/modules/services/monitoring/collectd.nix @@ -8,7 +8,7 @@ let conf = pkgs.writeText "collectd.conf" '' BaseDir "${cfg.dataDir}" PIDFile "${cfg.pidFile}" - AutoLoadPlugin ${if cfg.autoLoadPlugin then "true" else "false"} + AutoLoadPlugin ${boolToString cfg.autoLoadPlugin} Hostname "${config.networking.hostName}" LoadPlugin syslog diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 97806d5d83eb..4fbacef788f9 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -5,8 +5,6 @@ with lib; let cfg = config.services.grafana; - b2s = val: if val then "true" else "false"; - envOptions = { PATHS_DATA = cfg.dataDir; PATHS_PLUGINS = "${cfg.dataDir}/plugins"; @@ -32,16 +30,16 @@ let SECURITY_ADMIN_PASSWORD = cfg.security.adminPassword; SECURITY_SECRET_KEY = cfg.security.secretKey; - USERS_ALLOW_SIGN_UP = b2s cfg.users.allowSignUp; - USERS_ALLOW_ORG_CREATE = b2s cfg.users.allowOrgCreate; - USERS_AUTO_ASSIGN_ORG = b2s cfg.users.autoAssignOrg; + USERS_ALLOW_SIGN_UP = boolToString cfg.users.allowSignUp; + USERS_ALLOW_ORG_CREATE = boolToString cfg.users.allowOrgCreate; + USERS_AUTO_ASSIGN_ORG = boolToString cfg.users.autoAssignOrg; USERS_AUTO_ASSIGN_ORG_ROLE = cfg.users.autoAssignOrgRole; - AUTH_ANONYMOUS_ENABLED = b2s cfg.auth.anonymous.enable; + AUTH_ANONYMOUS_ENABLED = boolToString cfg.auth.anonymous.enable; AUTH_ANONYMOUS_ORG_NAME = cfg.auth.anonymous.org_name; AUTH_ANONYMOUS_ORG_ROLE = cfg.auth.anonymous.org_role; - ANALYTICS_REPORTING_ENABLED = b2s cfg.analytics.reporting.enable; + ANALYTICS_REPORTING_ENABLED = boolToString cfg.analytics.reporting.enable; } // cfg.extraOptions; in { |