mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 04:04:06 +01:00
nixos/uptime: drop
Package doesn't exist anymore, let's get rid of this.
This commit is contained in:
parent
7ff9861cf7
commit
ffe515fa07
4 changed files with 6 additions and 123 deletions
|
|
@ -86,6 +86,8 @@
|
|||
|
||||
- The packages `iw` and `wirelesstools` (`iwconfig`, `iwlist`, etc.) are no longer installed implicitly if wireless networking has been enabled.
|
||||
|
||||
- `services.uptime` has been removed because the package it relies on does not exist anymore in nixpkgs.
|
||||
|
||||
- `services.kubernetes.addons.dns.coredns` has been renamed to `services.kubernetes.addons.dns.corednsImage` and now expects a
|
||||
package instead of attrs. Now, by default, nixpkgs.coredns in conjunction with dockerTools.buildImage is used, instead
|
||||
of pulling the upstream container image from Docker Hub. If you want the old behavior, you can set:
|
||||
|
|
|
|||
|
|
@ -1069,7 +1069,6 @@
|
|||
./services/monitoring/unpoller.nix
|
||||
./services/monitoring/ups.nix
|
||||
./services/monitoring/uptime-kuma.nix
|
||||
./services/monitoring/uptime.nix
|
||||
./services/monitoring/vlagent.nix
|
||||
./services/monitoring/vmagent.nix
|
||||
./services/monitoring/vmalert.nix
|
||||
|
|
|
|||
|
|
@ -328,6 +328,10 @@ in
|
|||
(mkRemovedOptionModule [ "services" "unifi-video" ]
|
||||
"The unifi-video package and the corresponding module have been removed as the software has been unsupported since 2021 and requires a MongoDB version that has reached end of life."
|
||||
)
|
||||
(mkRemovedOptionModule [
|
||||
"services"
|
||||
"uptime"
|
||||
] "The package for services.uptime has been removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [ "services" "venus" ] "The corresponding package was removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [
|
||||
"services"
|
||||
|
|
|
|||
|
|
@ -1,122 +0,0 @@
|
|||
{
|
||||
config,
|
||||
options,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
literalExpression
|
||||
mkOption
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkMerge
|
||||
types
|
||||
optional
|
||||
;
|
||||
|
||||
cfg = config.services.uptime;
|
||||
opt = options.services.uptime;
|
||||
|
||||
configDir = pkgs.runCommand "config" { preferLocalBuild = true; } (
|
||||
if cfg.configFile != null then
|
||||
''
|
||||
mkdir $out
|
||||
ext=`echo ${cfg.configFile} | grep -o \\..*`
|
||||
ln -sv ${cfg.configFile} $out/default$ext
|
||||
ln -sv /var/lib/uptime/runtime.json $out/runtime.json
|
||||
''
|
||||
else
|
||||
''
|
||||
mkdir $out
|
||||
cat ${pkgs.nodePackages.node-uptime}/lib/node_modules/node-uptime/config/default.yaml > $out/default.yaml
|
||||
cat >> $out/default.yaml <<EOF
|
||||
|
||||
autoStartMonitor: false
|
||||
|
||||
mongodb:
|
||||
connectionString: 'mongodb://localhost/uptime'
|
||||
EOF
|
||||
ln -sv /var/lib/uptime/runtime.json $out/runtime.json
|
||||
''
|
||||
);
|
||||
in
|
||||
{
|
||||
options.services.uptime = {
|
||||
configFile = mkOption {
|
||||
description = ''
|
||||
The uptime configuration file
|
||||
|
||||
If mongodb: server != localhost, please set usesRemoteMongo = true
|
||||
|
||||
If you only want to run the monitor, please set enableWebService = false
|
||||
and enableSeparateMonitoringService = true
|
||||
|
||||
If autoStartMonitor: false (recommended) and you want to run both
|
||||
services, please set enableSeparateMonitoringService = true
|
||||
'';
|
||||
|
||||
type = types.nullOr types.path;
|
||||
|
||||
default = null;
|
||||
};
|
||||
|
||||
usesRemoteMongo = mkOption {
|
||||
description = "Whether the configuration file specifies a remote mongo instance";
|
||||
|
||||
default = false;
|
||||
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
enableWebService = mkEnableOption "the uptime monitoring program web service";
|
||||
|
||||
enableSeparateMonitoringService = mkEnableOption "the uptime monitoring service" // {
|
||||
default = cfg.enableWebService;
|
||||
defaultText = literalExpression "config.${opt.enableWebService}";
|
||||
};
|
||||
|
||||
nodeEnv = mkOption {
|
||||
description = "The node environment to run in (development, production, etc.)";
|
||||
|
||||
type = types.str;
|
||||
|
||||
default = "production";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enableWebService {
|
||||
systemd.services.uptime = {
|
||||
description = "uptime web service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = {
|
||||
NODE_CONFIG_DIR = configDir;
|
||||
NODE_ENV = cfg.nodeEnv;
|
||||
NODE_PATH = "${pkgs.nodePackages.node-uptime}/lib/node_modules/node-uptime/node_modules";
|
||||
};
|
||||
preStart = "mkdir -p /var/lib/uptime";
|
||||
serviceConfig.ExecStart = "${pkgs.lib.getExe pkgs.nodejs-slim} ${pkgs.nodePackages.node-uptime}/lib/node_modules/node-uptime/app.js";
|
||||
};
|
||||
|
||||
services.mongodb.enable = mkIf (!cfg.usesRemoteMongo) true;
|
||||
})
|
||||
(mkIf cfg.enableSeparateMonitoringService {
|
||||
systemd.services.uptime-monitor = {
|
||||
description = "uptime monitoring service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = optional cfg.enableWebService "uptime.service";
|
||||
after = optional cfg.enableWebService "uptime.service";
|
||||
environment = {
|
||||
NODE_CONFIG_DIR = configDir;
|
||||
NODE_ENV = cfg.nodeEnv;
|
||||
NODE_PATH = "${pkgs.nodePackages.node-uptime}/lib/node_modules/node-uptime/node_modules";
|
||||
};
|
||||
# Ugh, need to wait for web service to be up
|
||||
preStart = if cfg.enableWebService then "sleep 1s" else "mkdir -p /var/lib/uptime";
|
||||
serviceConfig.ExecStart = "${pkgs.lib.getExe pkgs.nodejs-slim} ${pkgs.nodePackages.node-uptime}/lib/node_modules/node-uptime/monitor.js";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue