From 7af8ace239b12d21a3f1aef32b87f1fd79c00c36 Mon Sep 17 00:00:00 2001 From: Bruno Adelé Date: Wed, 19 Apr 2023 20:05:27 +0200 Subject: nixos/smokeping: Format smokeping source code --- nixos/modules/services/networking/smokeping.nix | 69 +++++++++++++------------ 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/nixos/modules/services/networking/smokeping.nix b/nixos/modules/services/networking/smokeping.nix index 19ab3f1aa48..e0821e38c07 100644 --- a/nixos/modules/services/networking/smokeping.nix +++ b/nixos/modules/services/networking/smokeping.nix @@ -8,36 +8,36 @@ let smokepingPidDir = "/run"; configFile = if cfg.config == null - then - '' - *** General *** - cgiurl = ${cfg.cgiUrl} - contact = ${cfg.ownerEmail} - datadir = ${smokepingHome}/data - imgcache = ${smokepingHome}/cache - imgurl = ${cfg.imgUrl} - linkstyle = ${cfg.linkStyle} - ${lib.optionalString (cfg.mailHost != "") "mailhost = ${cfg.mailHost}"} - owner = ${cfg.owner} - pagedir = ${smokepingHome}/cache - piddir = ${smokepingPidDir} - ${lib.optionalString (cfg.sendmail != null) "sendmail = ${cfg.sendmail}"} - smokemail = ${cfg.smokeMailTemplate} - *** Presentation *** - template = ${cfg.presentationTemplate} - ${cfg.presentationConfig} - *** Alerts *** - ${cfg.alertConfig} - *** Database *** - ${cfg.databaseConfig} - *** Probes *** - ${cfg.probeConfig} - *** Targets *** - ${cfg.targetConfig} - ${cfg.extraConfig} - '' - else - cfg.config; + then + '' + *** General *** + cgiurl = ${cfg.cgiUrl} + contact = ${cfg.ownerEmail} + datadir = ${smokepingHome}/data + imgcache = ${smokepingHome}/cache + imgurl = ${cfg.imgUrl} + linkstyle = ${cfg.linkStyle} + ${lib.optionalString (cfg.mailHost != "") "mailhost = ${cfg.mailHost}"} + owner = ${cfg.owner} + pagedir = ${smokepingHome}/cache + piddir = ${smokepingPidDir} + ${lib.optionalString (cfg.sendmail != null) "sendmail = ${cfg.sendmail}"} + smokemail = ${cfg.smokeMailTemplate} + *** Presentation *** + template = ${cfg.presentationTemplate} + ${cfg.presentationConfig} + *** Alerts *** + ${cfg.alertConfig} + *** Database *** + ${cfg.databaseConfig} + *** Probes *** + ${cfg.probeConfig} + *** Targets *** + ${cfg.targetConfig} + ${cfg.extraConfig} + '' + else + cfg.config; configPath = pkgs.writeText "smokeping.conf" configFile; cgiHome = pkgs.writeScript "smokeping.fcgi" '' @@ -141,7 +141,7 @@ in ''; }; linkStyle = mkOption { - type = types.enum ["original" "absolute" "relative"]; + type = types.enum [ "original" "absolute" "relative" ]; default = "relative"; example = "absolute"; description = lib.mdDoc "DNS name for the urls generated in the cgi."; @@ -301,7 +301,8 @@ in ]; security.wrappers = { fping = - { setuid = true; + { + setuid = true; owner = "root"; group = "root"; source = "${pkgs.fping}/bin/fping"; @@ -347,8 +348,8 @@ in ''; }; systemd.services.thttpd = mkIf cfg.webService { - requiredBy = [ "multi-user.target"]; - requires = [ "smokeping.service"]; + requiredBy = [ "multi-user.target" ]; + requires = [ "smokeping.service" ]; path = with pkgs; [ bash rrdtool smokeping thttpd ]; serviceConfig = { Restart = "always"; -- cgit 1.4.1