Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18650,6 +18650,11 @@
githubId = 47303199;
name = "Simon Gutgesell";
};
non-bin = {
name = "Alice Jacka";
github = "non-bin";
githubId = 36313060;
};
noodlez1232 = {
email = "contact@nathanielbarragan.xyz";
matrix = "@noodlez1232:matrix.org";
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2511.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@

- [paisa](https://github.com/ananthakumaran/paisa), a personal finance tracker and dashboard. Available as [services.paisa](#opt-services.paisa.enable).

- [beszel](https://github.com/henrygd/beszel), Lightweight server monitoring hub with historical data, docker stats, and alerts. Available as [services.beszel.agent](#opt-services.beszel.agent.enable) and [services.beszel.hub](#opt-services.beszel.hub.enable).

- [conman](https://github.com/dun/conman), a serial console management program. Available as [services.conman](#opt-services.conman.enable).

- [KMinion](https://github.com/redpanda-data/kminion), feature-rich Prometheus exporter for Apache Kafka. Available as [services.prometheus.exporters.kafka](options.html#opt-services.prometheus.exporters.kafka).
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@
./services/monitoring/apcupsd.nix
./services/monitoring/arbtt.nix
./services/monitoring/below.nix
./services/monitoring/beszel.nix
./services/monitoring/bosun.nix
./services/monitoring/cadvisor.nix
./services/monitoring/certspotter.nix
Expand Down
81 changes: 81 additions & 0 deletions nixos/modules/services/monitoring/beszel.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.beszel;
in
{
meta.maintainers = [ lib.maintainers.non-bin ];

options.services.beszel = {
agent = {
enable = lib.mkEnableOption "agent";
key = lib.mkOption {
type = lib.types.str;
description = "Public key(s) for SSH authentication";
example = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGBvkz0O6T8dzn1yJTkj3wOSu/7IehuxVPSM5tKzsx5x";
};
listen = lib.mkOption {
type = lib.types.str;
default = "0.0.0.0:45876";
description = "Address and port to listen on";
example = "127.0.0.1:3265";
};
};

hub = {
enable = lib.mkEnableOption "hub";
httpListen = lib.mkOption {
type = lib.types.str;
default = "0.0.0.0:80";
description = "Address and port to listen for http traffic";
example = "192.168.0.4:8090";
};
httpsListen = lib.mkOption {
type = lib.types.str;
default = "";
description = "Address and port to listen for https traffic. If specified, http traffic will be redirected to https";
example = "0.0.0.0:443";
};
domains = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Domains to listen on. If specified, http traffic will be redirected to https, and httpsListen will default to `0.0.0.0:443`";
example = [ "example.com" ];
};
};
};

config = {
environment.systemPackages = lib.mkIf (cfg.agent.enable || cfg.hub.enable) [ pkgs.beszel ];

systemd.services = {
beszel-agent = lib.mkIf cfg.agent.enable {
description = "Beszel Monitoring System monitoring agent";
wantedBy = [ "multi-user.target" ];
after = [ "networking.target" ];
serviceConfig = {
ExecStart = ''${pkgs.beszel}/bin/beszel-agent -key "${cfg.agent.key}" -listen "${cfg.agent.listen}"'';
};
};

beszel-hub = lib.mkIf cfg.hub.enable {
description = "Beszel Monitoring System hub server";
wantedBy = [ "multi-user.target" ];
after = [ "networking.target" ];
serviceConfig = {
ExecStart = ''${pkgs.beszel}/bin/beszel-hub serve ${
if ((lib.length cfg.hub.domains) > 0) then
(''"'' + (lib.concatStringsSep ''" "'' cfg.hub.domains) + ''"'')
else
""
} --http "${cfg.hub.httpListen}" --https "${cfg.hub.httpsListen}"'';
WorkingDirectory = "/var/db/beszel";
};
};
};
};
}
Loading