From 8f9336460b3cbfdb0859919fc73cb8c8ff40a1c2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Fri, 30 Aug 2024 00:46:57 +0200 Subject: [PATCH] nixos/services.grafana_reporter: remove `with lib;` --- .../services/monitoring/grafana-reporter.nix | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/nixos/modules/services/monitoring/grafana-reporter.nix b/nixos/modules/services/monitoring/grafana-reporter.nix index 528041cab37a..91725206ea12 100644 --- a/nixos/modules/services/monitoring/grafana-reporter.nix +++ b/nixos/modules/services/monitoring/grafana-reporter.nix @@ -1,53 +1,50 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.grafana_reporter; in { options.services.grafana_reporter = { - enable = mkEnableOption "grafana_reporter"; + enable = lib.mkEnableOption "grafana_reporter"; grafana = { - protocol = mkOption { + protocol = lib.mkOption { description = "Grafana protocol."; default = "http"; - type = types.enum ["http" "https"]; + type = lib.types.enum ["http" "https"]; }; - addr = mkOption { + addr = lib.mkOption { description = "Grafana address."; default = "127.0.0.1"; - type = types.str; + type = lib.types.str; }; - port = mkOption { + port = lib.mkOption { description = "Grafana port."; default = 3000; - type = types.port; + type = lib.types.port; }; }; - addr = mkOption { + addr = lib.mkOption { description = "Listening address."; default = "127.0.0.1"; - type = types.str; + type = lib.types.str; }; - port = mkOption { + port = lib.mkOption { description = "Listening port."; default = 8686; - type = types.port; + type = lib.types.port; }; - templateDir = mkOption { + templateDir = lib.mkOption { description = "Optional template directory to use custom tex templates"; default = pkgs.grafana_reporter; - defaultText = literalExpression "pkgs.grafana_reporter"; - type = types.either types.str types.path; + defaultText = lib.literalExpression "pkgs.grafana_reporter"; + type = lib.types.either lib.types.str lib.types.path; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.grafana_reporter = { description = "Grafana Reporter Service Daemon"; wantedBy = ["multi-user.target"];