Skip to content

Commit 4623656

Browse files
committed
librenms: remove legacy weathermap
1 parent 764aee3 commit 4623656

File tree

1 file changed

+1
-71
lines changed

1 file changed

+1
-71
lines changed

modules/management/librenms.nix

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
1-
{ self, lib, config, pkgs, ... }:
2-
3-
let
4-
weathermap = pkgs.stdenv.mkDerivation {
5-
pname = "librenms-weathermap";
6-
version = "2023-12-17-unstable";
7-
8-
src = pkgs.fetchFromGitHub {
9-
owner = "librenms-plugins";
10-
repo = "Weathermap";
11-
# master as of 04.03.2025
12-
rev = "ea57b454eb042408a6628fc3d8dff8176563547f";
13-
hash = "sha256-q+/j16FNVNseJMm1p7pj6YWX5RpGVp367+s/NChcxHo=";
14-
};
15-
16-
postPatch = ''
17-
substituteInPlace weathermap.php \
18-
--replace-fail '/usr/bin/rrdtool' '${lib.getExe' pkgs.rrdtool "rrdtool"}'
19-
'';
20-
21-
installPhase = ''
22-
mkdir $out
23-
mv * $out
24-
rm -rf $out/configs
25-
ln -s /var/lib/librenms-weathermap $out/configs
26-
'';
27-
};
28-
in
1+
{ self, config, ... }:
292

303
{
314
sops.secrets."nms_db_pass" = {
@@ -35,12 +8,6 @@ in
358

369
services.librenms = {
3710
enable = true;
38-
package = pkgs.librenms.override {
39-
plugins = [{
40-
dir = weathermap;
41-
name = "Weathermap";
42-
}];
43-
};
4411
database = {
4512
host = "svc-mari01.dd-ix.net";
4613
port = 3306;
@@ -59,43 +26,6 @@ in
5926

6027
onlySSL = true;
6128
useACMEHost = "nms.${config.dd-ix.domain}";
62-
63-
locations."/plugins/Weathermap/" = {
64-
# taken from
65-
# https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/services/monitoring/librenms.nix#L482C7-L483C62
66-
index = "index.php";
67-
tryFiles = "$uri $uri/ /index.php?$query_string";
68-
extraConfig = ''
69-
allow 2a01:7700:80b0:e000::/64;
70-
deny all;
71-
'';
72-
};
73-
};
74-
};
75-
76-
systemd = {
77-
services.librenms-weathermap-poller = {
78-
description = "LibreNMS Weathermap Poller";
79-
80-
path = [
81-
config.services.librenms.package.passthru.phpPackage
82-
];
83-
84-
serviceConfig = {
85-
Type = "oneshot";
86-
inherit (config.systemd.services.librenms-scheduler.serviceConfig) WorkingDirectory User Group;
87-
ExecStart = "${config.systemd.services.librenms-scheduler.serviceConfig.WorkingDirectory}/html/plugins/Weathermap/map-poller.php";
88-
};
89-
};
90-
91-
timers.librenms-weathermap-poller = {
92-
description = "LibreNMS Weathermap Poller";
93-
wantedBy = [ "timers.target" ];
94-
timerConfig = {
95-
# every 5min
96-
OnCalendar = "*:0/5";
97-
AccuracySec = "1second";
98-
};
9929
};
10030
};
10131
}

0 commit comments

Comments
 (0)