From 934111c36fde26c15027a5a77fe0e543f6f57fc5 Mon Sep 17 00:00:00 2001 From: dish Date: Tue, 3 Mar 2026 17:17:27 -0500 Subject: [PATCH] nixos/statsd: drop Statsd packages don't even exist in nixpkgs anymore. no need for it. --- .../manual/release-notes/rl-2605.section.md | 2 + nixos/modules/module-list.nix | 1 - nixos/modules/rename.nix | 3 + nixos/modules/services/monitoring/statsd.nix | 154 ------------------ 4 files changed, 5 insertions(+), 155 deletions(-) delete mode 100644 nixos/modules/services/monitoring/statsd.nix diff --git a/nixos/doc/manual/release-notes/rl-2605.section.md b/nixos/doc/manual/release-notes/rl-2605.section.md index 0254ba7fb865..7fa9f0ee7361 100644 --- a/nixos/doc/manual/release-notes/rl-2605.section.md +++ b/nixos/doc/manual/release-notes/rl-2605.section.md @@ -80,6 +80,8 @@ - `sing-box` has been updated to 1.13.0, which has removed some deprecated options. See [upstream documentation](https://sing-box.sagernet.org/configuration/) for details and migration options. +- `services.statsd` has been removed because the packages it relies on do not exist anymore in nixpkgs. + - `services.tandoor-recipes` now uses a sub-directory for media files by default starting with `26.05`. Existing setups should move media files out of the data directory and adjust `services.tandoor-recipes.extraConfig.MEDIA_ROOT` accordingly. See [Migrating media files for pre 26.05 installations](#module-services-tandoor-recipes-migrating-media). - `rustic` was upgraded to `0.11.x`, which contains breaking [changes to command-line parameters and configuration file](https://rustic.cli.rs/docs/breaking_changes.html#0110). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index e7fb4c7f463f..e414c8a5ed0d 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1057,7 +1057,6 @@ ./services/monitoring/scrutiny.nix ./services/monitoring/smartd.nix ./services/monitoring/snmpd.nix - ./services/monitoring/statsd.nix ./services/monitoring/sysstat.nix ./services/monitoring/teamviewer.nix ./services/monitoring/telegraf.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 68f89cf0c27b..18c020c9e95e 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -319,6 +319,9 @@ in the program being unmaintained. The options `programs.msmtp.*` can be used instead. '') + (mkRemovedOptionModule [ "services" "statsd" ] '' + The statsd module was removed because the packages it uses have been removed from nixpkgs. + '') (mkRemovedOptionModule [ "services" "sourcehut" ] '' The sourcehut packages and the corresponding module have been removed due to being broken and unmaintained. '') diff --git a/nixos/modules/services/monitoring/statsd.nix b/nixos/modules/services/monitoring/statsd.nix deleted file mode 100644 index 48bb0f0e93f3..000000000000 --- a/nixos/modules/services/monitoring/statsd.nix +++ /dev/null @@ -1,154 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - - cfg = config.services.statsd; - - isBuiltinBackend = - name: - builtins.elem name [ - "graphite" - "console" - "repeater" - ]; - - backendsToPackages = - let - mkMap = list: name: if isBuiltinBackend name then list else list ++ [ pkgs.nodePackages.${name} ]; - in - lib.foldl mkMap [ ]; - - configFile = pkgs.writeText "statsd.conf" '' - { - address: "${cfg.listenAddress}", - port: "${toString cfg.port}", - mgmt_address: "${cfg.mgmt_address}", - mgmt_port: "${toString cfg.mgmt_port}", - backends: [${ - lib.concatMapStringsSep "," ( - name: if (isBuiltinBackend name) then ''"./backends/${name}"'' else ''"${name}"'' - ) cfg.backends - }], - ${lib.optionalString (cfg.graphiteHost != null) ''graphiteHost: "${cfg.graphiteHost}",''} - ${lib.optionalString (cfg.graphitePort != null) ''graphitePort: "${toString cfg.graphitePort}",''} - console: { - prettyprint: false - }, - log: { - backend: "stdout" - }, - automaticConfigReload: false${lib.optionalString (cfg.extraConfig != null) ","} - ${cfg.extraConfig} - } - ''; - - deps = pkgs.buildEnv { - name = "statsd-runtime-deps"; - pathsToLink = [ "/lib" ]; - ignoreCollisions = true; - - paths = backendsToPackages cfg.backends; - }; - -in - -{ - - ###### interface - - options.services.statsd = { - - enable = lib.mkEnableOption "statsd"; - - listenAddress = lib.mkOption { - description = "Address that statsd listens on over UDP"; - default = "127.0.0.1"; - type = lib.types.str; - }; - - port = lib.mkOption { - description = "Port that stats listens for messages on over UDP"; - default = 8125; - type = lib.types.port; - }; - - mgmt_address = lib.mkOption { - description = "Address to run management TCP interface on"; - default = "127.0.0.1"; - type = lib.types.str; - }; - - mgmt_port = lib.mkOption { - description = "Port to run the management TCP interface on"; - default = 8126; - type = lib.types.port; - }; - - backends = lib.mkOption { - description = "List of backends statsd will use for data persistence"; - default = [ ]; - example = [ - "graphite" - "console" - "repeater" - "statsd-librato-backend" - "statsd-influxdb-backend" - ]; - type = lib.types.listOf lib.types.str; - }; - - graphiteHost = lib.mkOption { - description = "Hostname or IP of Graphite server"; - default = null; - type = lib.types.nullOr lib.types.str; - }; - - graphitePort = lib.mkOption { - description = "Port of Graphite server (i.e. carbon-cache)."; - default = null; - type = lib.types.nullOr lib.types.port; - }; - - extraConfig = lib.mkOption { - description = "Extra configuration options for statsd"; - default = ""; - type = lib.types.nullOr lib.types.str; - }; - - }; - - ###### implementation - - config = lib.mkIf cfg.enable { - - assertions = map (backend: { - assertion = !isBuiltinBackend backend -> lib.hasAttrByPath [ backend ] pkgs.nodePackages; - message = "Only builtin backends (graphite, console, repeater) or backends enumerated in `pkgs.nodePackages` are allowed!"; - }) cfg.backends; - - users.users.statsd = { - uid = config.ids.uids.statsd; - description = "Statsd daemon user"; - }; - - systemd.services.statsd = { - description = "Statsd Server"; - wantedBy = [ "multi-user.target" ]; - environment = { - NODE_PATH = "${deps}/lib/node_modules"; - }; - serviceConfig = { - ExecStart = "${pkgs.statsd}/bin/statsd ${configFile}"; - User = "statsd"; - }; - }; - - environment.systemPackages = [ pkgs.statsd ]; - - }; - -}