Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 93ba4ecd5860
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7218f3a791cf
Choose a head ref

Commits on Feb 12, 2020

  1. godot: 3.1.2 -> 3.2

    mirrexagon committed Feb 12, 2020
    Copy the full SHA
    cf8bb29 View commit details

Commits on Mar 4, 2020

  1. Copy the full SHA
    e7d6909 View commit details
  2. shorewall: fix RestartTriggers

    Julien Moutinho committed Mar 4, 2020

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    47f2793 View commit details

Commits on Mar 5, 2020

  1. Copy the full SHA
    815f25d View commit details
  2. dbeaver: fix hash

    marsam committed Mar 5, 2020
    Copy the full SHA
    6486d19 View commit details

Commits on Mar 6, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0ac24cc View commit details
  2. nixos/prometheus-snmp-exporter: update log options

    The allowed values have changed in bd3319d.
    
    0.15:
          --log.level="info"        Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]
          --log.format="logger:stderr"
                                    Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"
    
    0.17:
          --log.level=info          Only log messages with the given severity or above. One of: [debug, info, warn, error]
          --log.format=logfmt       Output format of log messages. One of: [logfmt, json]
    mmilata committed Mar 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    87f87fb View commit details
  3. nixos/prometheus-snmp-exporter: fix assertion

    The assertion was printed when user explicitly defined only the
    configurationPath option.
    mmilata committed Mar 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2a080ac View commit details
  4. nixos/prometheus-mail-exporter: fix assertion

    The assertion was printed when user explicitly defined only the
    configFile option.
    mmilata committed Mar 6, 2020
    Copy the full SHA
    3b5cf35 View commit details
  5. nixos/prometheus-mail-exporter: misc fixes

     - Fix misspelled option. mkRenamedOptionModule is not used because the
       option hasn't really worked before.
     - Add missing cfg.telemetryPath arg to ExecStart.
     - Fix mkdir invocation in test.
    mmilata committed Mar 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e7ed790 View commit details
  6. topgrade: 4.0.2 -> 4.2.0

    r-ryantm committed Mar 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2106ce0 View commit details
  7. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    66aea32 View commit details
  8. waf: move binary to $out/bin/

    Originally this was just the executable, but this breaks nix-shell
    usage. Instead, just do a normal directory.
    
    Fixes #79909
    matthewbauer authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    dfbe76a View commit details
  9. skypeforlinux: 8.55.0.141 -> 8.56.0.103

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    4665c94 View commit details
  10. Copy the full SHA
    b6245f5 View commit details
  11. rawtherapee: 5.7 -> 5.8

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    853bf46 View commit details
  12. zotero: 5.0.82 -> 5.0.83

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    9a2a995 View commit details
  13. urh: 2.8.2 -> 2.8.3

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    5925077 View commit details
  14. gdcm: 3.0.4 -> 3.0.5

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    ef1ace9 View commit details
  15. facter: 3.14.7 -> 3.14.8

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    d34475c View commit details
  16. elogind: 243.4 -> 243.7

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    2d1a19d View commit details
  17. osi: 0.108.4 -> 0.108.6

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    e04fab6 View commit details
  18. Copy the full SHA
    7703cc2 View commit details
  19. Copy the full SHA
    8a21b2f View commit details
  20. python27Packages.pyface: 6.1.1 -> 6.1.2

    r-ryantm authored and FRidh committed Mar 6, 2020

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    338639e View commit details
  21. Copy the full SHA
    9ce73d1 View commit details
  22. Copy the full SHA
    724e4d4 View commit details
  23. Copy the full SHA
    698cb68 View commit details
  24. micronaut: 1.3.0 -> 1.3.2

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    cf23018 View commit details
  25. metabase: 0.34.2 -> 0.34.3

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    90f0f47 View commit details
  26. librealsense: 2.31.0 -> 2.32.1

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    eafe585 View commit details
  27. rednotebook: 2.16 -> 2.18

    r-ryantm authored and FRidh committed Mar 6, 2020
    Copy the full SHA
    77f5b01 View commit details
  28. Copy the full SHA
    ec8946e View commit details
  29. Copy the full SHA
    4f8ea1e View commit details
  30. Copy the full SHA
    e824346 View commit details
  31. js_of_ocaml: 3.4.0 -> 3.5.2 (#75766)

    drive-by contributions, as I was playing around with this (it has better
    support for the `num` library, it seems.)
    
    js_of_ocaml: 3.4.0 -> 3.5.2
    ocamlPackages.js_of_ocaml-ppx_deriving_json: use ppxlib-0.12.0
    ocamlPackages.eliom: 6.8.0 → 6.10.1
    ocamlPackages.ocsigen-toolkit: 2.2.0 → 2.5.0
    ocamlPackages.ocsigen-start: 2.7.0 → 2.16.1
    
    Co-authored-by: Vincent Laporte <Vincent.Laporte@gmail.com>
    nomeata and vbgl authored Mar 6, 2020
    Copy the full SHA
    2d2a5a9 View commit details
  32. tree-sitter.builtGrammars: build parser libraries

    except for typescript that provokes an error.
    These libraries can be used on neovim 0.5 for instance.
    teto authored and Profpatsch committed Mar 6, 2020
    Copy the full SHA
    53ae5f7 View commit details
  33. shellcheck: add manpage and docs

    The shellcheck source code contains a manpage, so let’s add that to
    the output. For good measure, also copy the README to the doc output.
    
    The overrideMeta thing is taking care of setting the right position,
    so that `nix edit` points to this file instead of to the original
    haskellPackages definition.
    Profpatsch committed Mar 6, 2020
    Copy the full SHA
    0bc0c10 View commit details
  34. Merge pull request #81854 from mmilata/prometheus-exporters-fixes

    nixos/prometheus-*-exporters: minor fixes
    WilliButz authored Mar 6, 2020
    Copy the full SHA
    ff3c06a View commit details
  35. Updated and fixed libstdc++ issue

    Dillen Meijboom committed Mar 6, 2020
    Copy the full SHA
    c4f5f95 View commit details
  36. Merge pull request #81853 from marsam/fix-dbeaver-hash

    dbeaver: fix hash
    marsam authored Mar 6, 2020
    Copy the full SHA
    dea93ef View commit details
  37. Merge pull request #81847 from zowoq/crun

    crun: 0.12.2.1 -> 0.13
    marsam authored Mar 6, 2020
    Copy the full SHA
    462ecfb View commit details
  38. nixos/tests/prometheus-exporters: increase memory for rspamd

    Before this, the test failed because rspamd did invoke the oom-killer.
    WilliButz committed Mar 6, 2020
    Copy the full SHA
    0d832ee View commit details
  39. Merge pull request #81856 from r-ryantm/auto-update/topgrade

    topgrade: 4.0.2 -> 4.2.0
    marsam authored Mar 6, 2020
    Copy the full SHA
    b11c5e5 View commit details
  40. Merge pull request #81846 from zowoq/youtube-dl

    youtube-dl: 2020.03.01 -> 2020.03.06
    Ma27 authored Mar 6, 2020
    Copy the full SHA
    5d4fba7 View commit details
  41. Copy the full SHA
    ade67bd View commit details
  42. Copy the full SHA
    421a18f View commit details
  43. Merge pull request #81857 from mmilata/prometheus-mikrotik-exporter

    nixos/prometheus-mikrotik-exporter: init
    WilliButz authored Mar 6, 2020
    Copy the full SHA
    3cd57cf View commit details
  44. Merge pull request #81877 from Profpatsch/shellcheck-expose-manpage

    shellcheck: add manpage and docs
    Ma27 authored Mar 6, 2020
    Copy the full SHA
    b8d7d4f View commit details
  45. focuswriter: 1.7.4 -> 1.7.5

    r-ryantm committed Mar 6, 2020
    Copy the full SHA
    6e09f8c View commit details
Showing with 415 additions and 164 deletions.
  1. +15 −2 nixos/modules/services/monitoring/prometheus/exporters.nix
  2. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix
  3. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/collectd.nix
  4. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/dnsmasq.nix
  5. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix
  6. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/json.nix
  7. +5 −4 nixos/modules/services/monitoring/prometheus/exporters/mail.nix
  8. +66 −0 nixos/modules/services/monitoring/prometheus/exporters/mikrotik.nix
  9. +2 −2 nixos/modules/services/monitoring/prometheus/exporters/minio.nix
  10. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix
  11. +3 −3 nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
  12. +8 −8 nixos/modules/services/monitoring/prometheus/exporters/snmp.nix
  13. +2 −2 nixos/modules/services/monitoring/prometheus/exporters/unifi.nix
  14. +2 −2 nixos/modules/services/monitoring/prometheus/exporters/varnish.nix
  15. +1 −1 nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix
  16. +3 −2 nixos/modules/services/networking/shorewall.nix
  17. +3 −2 nixos/modules/services/networking/shorewall6.nix
  18. +42 −1 nixos/tests/prometheus-exporters.nix
  19. +3 −3 pkgs/applications/editors/focuswriter/default.nix
  20. +2 −2 pkgs/applications/editors/rednotebook/default.nix
  21. +2 −2 pkgs/applications/graphics/rawtherapee/default.nix
  22. +2 −2 pkgs/applications/misc/cherrytree/default.nix
  23. +1 −1 pkgs/applications/misc/dbeaver/default.nix
  24. +2 −2 pkgs/applications/misc/elogind/default.nix
  25. +2 −2 pkgs/applications/networking/instant-messengers/skypeforlinux/default.nix
  26. +3 −3 pkgs/applications/office/zotero/default.nix
  27. +2 −2 pkgs/applications/radio/urh/default.nix
  28. +8 −2 pkgs/applications/science/logic/why3/default.nix
  29. +3 −3 pkgs/applications/virtualization/crun/default.nix
  30. +2 −2 pkgs/development/compilers/intel-graphics-compiler/default.nix
  31. +6 −0 pkgs/development/coq-modules/QuickChick/default.nix
  32. +1 −1 pkgs/development/coq-modules/simple-io/default.nix
  33. +2 −2 pkgs/development/libraries/gdcm/default.nix
  34. +2 −2 pkgs/development/libraries/librealsense/default.nix
  35. +2 −2 pkgs/development/libraries/science/math/osi/default.nix
  36. +4 −6 pkgs/development/ocaml-modules/eliom/default.nix
  37. +5 −6 pkgs/development/ocaml-modules/ocsigen-start/default.nix
  38. +3 −3 pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
  39. +9 −2 pkgs/development/ocaml-modules/ppxlib/default.nix
  40. +3 −3 pkgs/development/python-modules/ckcc-protocol/default.nix
  41. +2 −2 pkgs/development/python-modules/denonavr/default.nix
  42. +3 −3 pkgs/development/python-modules/hstspreload/default.nix
  43. +2 −2 pkgs/development/python-modules/pikepdf/default.nix
  44. +3 −3 pkgs/development/python-modules/pyface/default.nix
  45. +3 −3 pkgs/development/python-modules/traitsui/default.nix
  46. +3 −3 pkgs/development/python-modules/uproot/default.nix
  47. +1 −1 pkgs/development/tools/build-managers/waf/default.nix
  48. +1 −1 pkgs/development/tools/build-managers/wafHook/setup-hook.sh
  49. +2 −2 pkgs/development/tools/godot/default.nix
  50. +3 −4 pkgs/development/tools/godot/dont_clobber_environment.patch
  51. +2 −2 pkgs/development/tools/micronaut/default.nix
  52. +4 −4 pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
  53. +2 −2 pkgs/development/tools/ocaml/js_of_ocaml/ppx_deriving_json.nix
  54. +14 −4 pkgs/development/tools/parsing/tree-sitter/default.nix
  55. +30 −0 pkgs/development/tools/parsing/tree-sitter/library.nix
  56. +47 −0 pkgs/development/tools/shellcheck/default.nix
  57. +2 −2 pkgs/servers/metabase/default.nix
  58. +22 −0 pkgs/servers/monitoring/prometheus/mikrotik-exporter.nix
  59. +21 −21 pkgs/tools/admin/pulumi/data.nix
  60. +3 −2 pkgs/tools/admin/pulumi/default.nix
  61. +5 −5 pkgs/tools/admin/pulumi/update.sh
  62. +3 −3 pkgs/tools/misc/topgrade/default.nix
  63. +3 −3 pkgs/tools/misc/youtube-dl/default.nix
  64. +2 −2 pkgs/tools/system/facter/default.nix
  65. +2 −1 pkgs/top-level/all-packages.nix
  66. +3 −1 pkgs/top-level/ocaml-packages.nix
17 changes: 15 additions & 2 deletions nixos/modules/services/monitoring/prometheus/exporters.nix
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ let
"fritzbox"
"json"
"mail"
"mikrotik"
"minio"
"nextcloud"
"nginx"
@@ -197,13 +198,25 @@ in

config = mkMerge ([{
assertions = [ {
assertion = (cfg.snmp.configurationPath == null) != (cfg.snmp.configuration == null);
assertion = cfg.snmp.enable -> (
(cfg.snmp.configurationPath == null) != (cfg.snmp.configuration == null)
);
message = ''
Please ensure you have either `services.prometheus.exporters.snmp.configuration'
or `services.prometheus.exporters.snmp.configurationPath' set!
'';
} {
assertion = (cfg.mail.configFile == null) != (cfg.mail.configuration == {});
assertion = cfg.mikrotik.enable -> (
(cfg.mikrotik.configFile == null) != (cfg.mikrotik.configuration == null)
);
message = ''
Please specify either `services.prometheus.exporters.mikrotik.configuration'
or `services.prometheus.exporters.mikrotik.configFile'.
'';
} {
assertion = cfg.mail.enable -> (
(cfg.mail.configFile == null) != (cfg.mail.configuration == null)
);
message = ''
Please specify either 'services.prometheus.exporters.mail.configuration'
or 'services.prometheus.exporters.mail.configFile'.
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ in {
ExecStart = ''
${pkgs.prometheus-blackbox-exporter}/bin/blackbox_exporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--config.file ${adjustedConfigFile} \
--config.file ${escapeShellArg adjustedConfigFile} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ in
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-collectd-exporter}/bin/collectd_exporter \
-log.format ${cfg.logFormat} \
-log.format ${escapeShellArg cfg.logFormat} \
-log.level ${cfg.logLevel} \
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
${collectSettingsArgs} \
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ in
${pkgs.prometheus-dnsmasq-exporter}/bin/dnsmasq_exporter \
--listen ${cfg.listenAddress}:${toString cfg.port} \
--dnsmasq ${cfg.dnsmasqListenAddress} \
--leases_path ${cfg.leasesPath} \
--leases_path ${escapeShellArg cfg.leasesPath} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ in
${pkgs.prometheus-dovecot-exporter}/bin/dovecot_exporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
--dovecot.socket-path ${cfg.socketPath} \
--dovecot.socket-path ${escapeShellArg cfg.socketPath} \
--dovecot.scopes ${concatStringsSep "," cfg.scopes} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ in
ExecStart = ''
${pkgs.prometheus-json-exporter}/bin/prometheus-json-exporter \
--port ${toString cfg.port} \
${cfg.url} ${cfg.configFile} \
${cfg.url} ${escapeShellArg cfg.configFile} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ let
Timeout until mails are considered "didn't make it".
'';
};
disableFileDelition = mkOption {
disableFileDeletion = mkOption {
type = types.bool;
default = false;
description = ''
@@ -127,8 +127,8 @@ in
'';
};
configuration = mkOption {
type = types.submodule exporterOptions;
default = {};
type = types.nullOr (types.submodule exporterOptions);
default = null;
description = ''
Specify the mailexporter configuration file to use.
'';
@@ -147,8 +147,9 @@ in
ExecStart = ''
${pkgs.prometheus-mail-exporter}/bin/mailexporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
--config.file ${
if cfg.configuration != {} then configurationFile else cfg.configFile
if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configFile)
} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ config, lib, pkgs, options }:

with lib;

let
cfg = config.services.prometheus.exporters.mikrotik;
in
{
port = 9436;
extraOpts = {
configFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Path to a mikrotik exporter configuration file. Mutually exclusive with
<option>configuration</option> option.
'';
example = literalExample "./mikrotik.yml";
};

configuration = mkOption {
type = types.nullOr types.attrs;
default = null;
description = ''
Mikrotik exporter configuration as nix attribute set. Mutually exclusive with
<option>configFile</option> option.
See <link xlink:href="https://github.com/nshttpd/mikrotik-exporter/blob/master/README.md"/>
for the description of the configuration file format.
'';
example = literalExample ''
{
devices = [
{
name = "my_router";
address = "10.10.0.1";
user = "prometheus";
password = "changeme";
}
];
features = {
bgp = true;
dhcp = true;
routes = true;
optics = true;
};
}
'';
};
};
serviceOpts = let
configFile = if cfg.configFile != null
then cfg.configFile
else "${pkgs.writeText "mikrotik-exporter.yml" (builtins.toJSON cfg.configuration)}";
in {
serviceConfig = {
# -port is misleading name, it actually accepts address too
ExecStart = ''
${pkgs.prometheus-mikrotik-exporter}/bin/mikrotik-exporter \
-config-file=${escapeShellArg configFile} \
-port=${cfg.listenAddress}:${toString cfg.port} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
};
}
Original file line number Diff line number Diff line change
@@ -54,8 +54,8 @@ in
${pkgs.prometheus-minio-exporter}/bin/minio-exporter \
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
-minio.server ${cfg.minioAddress} \
-minio.access-key ${cfg.minioAccessKey} \
-minio.access-secret ${cfg.minioAccessSecret} \
-minio.access-key ${escapeShellArg cfg.minioAccessKey} \
-minio.access-secret ${escapeShellArg cfg.minioAccessSecret} \
${optionalString cfg.minioBucketStats "-minio.bucket-stats"} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ in
-u ${cfg.username} \
-t ${cfg.timeout} \
-l ${cfg.url} \
-p @${cfg.passwordFile} \
-p ${escapeShellArg "@${cfg.passwordFile}"} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
Original file line number Diff line number Diff line change
@@ -67,15 +67,15 @@ in
${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
--postfix.showq_path ${cfg.showqPath} \
--postfix.showq_path ${escapeShellArg cfg.showqPath} \
${concatStringsSep " \\\n " (cfg.extraFlags
++ optional cfg.systemd.enable "--systemd.enable"
++ optional cfg.systemd.enable (if cfg.systemd.slice != null
then "--systemd.slice ${cfg.systemd.slice}"
else "--systemd.unit ${cfg.systemd.unit}")
++ optional (cfg.systemd.enable && (cfg.systemd.journalPath != null))
"--systemd.journal_path ${cfg.systemd.journalPath}"
++ optional (!cfg.systemd.enable) "--postfix.logfile_path ${cfg.logfilePath}")}
"--systemd.journal_path ${escapeShellArg cfg.systemd.journalPath}"
++ optional (!cfg.systemd.enable) "--postfix.logfile_path ${escapeShellArg cfg.logfilePath}")}
'';
};
};
16 changes: 8 additions & 8 deletions nixos/modules/services/monitoring/prometheus/exporters/snmp.nix
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ in

configuration = mkOption {
type = types.nullOr types.attrs;
default = {};
default = null;
description = ''
Snmp exporter configuration as nix attribute set. Mutually exclusive with 'configurationPath' option.
'';
@@ -36,15 +36,15 @@ in
};

logFormat = mkOption {
type = types.str;
default = "logger:stderr";
type = types.enum ["logfmt" "json"];
default = "logfmt";
description = ''
Set the log target and format.
Output format of log messages.
'';
};

logLevel = mkOption {
type = types.enum ["debug" "info" "warn" "error" "fatal"];
type = types.enum ["debug" "info" "warn" "error"];
default = "info";
description = ''
Only log messages with the given severity or above.
@@ -54,13 +54,13 @@ in
serviceOpts = let
configFile = if cfg.configurationPath != null
then cfg.configurationPath
else "${pkgs.writeText "snmp-eporter-conf.yml" (builtins.toJSON cfg.configuration)}";
else "${pkgs.writeText "snmp-exporter-conf.yml" (builtins.toJSON cfg.configuration)}";
in {
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-snmp-exporter.bin}/bin/snmp_exporter \
--config.file=${configFile} \
--log.format=${cfg.logFormat} \
--config.file=${escapeShellArg configFile} \
--log.format=${escapeShellArg cfg.logFormat} \
--log.level=${cfg.logLevel} \
--web.listen-address=${cfg.listenAddress}:${toString cfg.port} \
${concatStringsSep " \\\n " cfg.extraFlags}
Original file line number Diff line number Diff line change
@@ -55,8 +55,8 @@ in
${pkgs.prometheus-unifi-exporter}/bin/unifi_exporter \
-telemetry.addr ${cfg.listenAddress}:${toString cfg.port} \
-unifi.addr ${cfg.unifiAddress} \
-unifi.username ${cfg.unifiUsername} \
-unifi.password ${cfg.unifiPassword} \
-unifi.username ${escapeShellArg cfg.unifiUsername} \
-unifi.password ${escapeShellArg cfg.unifiPassword} \
-unifi.timeout ${cfg.unifiTimeout} \
${optionalString cfg.unifiInsecure "-unifi.insecure" } \
${concatStringsSep " \\\n " cfg.extraFlags}
Original file line number Diff line number Diff line change
@@ -74,10 +74,10 @@ in
${pkgs.prometheus-varnish-exporter}/bin/prometheus_varnish_exporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--web.telemetry-path ${cfg.telemetryPath} \
--varnishstat-path ${cfg.varnishStatPath} \
--varnishstat-path ${escapeShellArg cfg.varnishStatPath} \
${concatStringsSep " \\\n " (cfg.extraFlags
++ optional (cfg.healthPath != null) "--web.health-path ${cfg.healthPath}"
++ optional (cfg.instance != null) "-n ${cfg.instance}"
++ optional (cfg.instance != null) "-n ${escapeShellArg cfg.instance}"
++ optional cfg.noExit "--no-exit"
++ optional cfg.withGoMetrics "--with-go-metrics"
++ optional cfg.verbose "--verbose"
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ in {
${optionalString cfg.verbose "-v"} \
${optionalString cfg.singleSubnetPerField "-s"} \
${optionalString cfg.withRemoteIp "-r"} \
${optionalString (cfg.wireguardConfig != null) "-n ${cfg.wireguardConfig}"}
${optionalString (cfg.wireguardConfig != null) "-n ${escapeShellArg cfg.wireguardConfig}"}
'';
};
};
5 changes: 3 additions & 2 deletions nixos/modules/services/networking/shorewall.nix
Original file line number Diff line number Diff line change
@@ -26,13 +26,14 @@ in {
description = "The shorewall package to use.";
};
configs = lib.mkOption {
type = types.attrsOf types.str;
type = types.attrsOf types.lines;
default = {};
description = ''
This option defines the Shorewall configs.
The attribute name defines the name of the config,
and the attribute value defines the content of the config.
'';
apply = lib.mapAttrs (name: text: pkgs.writeText "${name}" text);
};
};
};
@@ -62,7 +63,7 @@ in {
'';
};
environment = {
etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall/${name}" {text=conf;}) cfg.configs;
etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall/${name}" {source=conf;}) cfg.configs;
systemPackages = [ cfg.package ];
};
};
5 changes: 3 additions & 2 deletions nixos/modules/services/networking/shorewall6.nix
Original file line number Diff line number Diff line change
@@ -26,13 +26,14 @@ in {
description = "The shorewall package to use.";
};
configs = lib.mkOption {
type = types.attrsOf types.str;
type = types.attrsOf types.lines;
default = {};
description = ''
This option defines the Shorewall configs.
The attribute name defines the name of the config,
and the attribute value defines the content of the config.
'';
apply = lib.mapAttrs (name: text: pkgs.writeText "${name}" text);
};
};
};
@@ -62,7 +63,7 @@ in {
'';
};
environment = {
etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall6/${name}" {text=conf;}) cfg.configs;
etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall6/${name}" {source=conf;}) cfg.configs;
systemPackages = [ cfg.package ];
};
};
Loading