diff --git a/nixos/modules/services/networking/sing-box.nix b/nixos/modules/services/networking/sing-box.nix index f5ab12537e96..104c75c8105c 100644 --- a/nixos/modules/services/networking/sing-box.nix +++ b/nixos/modules/services/networking/sing-box.nix @@ -38,6 +38,27 @@ in }; config = lib.mkIf cfg.enable { + assertions = + let + rules = cfg.settings.route.rules or [ ]; + in + [ + { + assertion = !lib.any (r: r ? source_geoip || r ? geoip) rules; + message = '' + Deprecated option `services.sing-box.settings.route.rules.*.{source_geoip,geoip}` is set. + See https://sing-box.sagernet.org/migration/#migrate-geoip-to-rule-sets for migration instructions. + ''; + } + { + assertion = !lib.any (r: r ? geosite) rules; + message = '' + Deprecated option `services.sing-box.settings.route.rules.*.geosite` is set. + See https://sing-box.sagernet.org/migration/#migrate-geosite-to-rule-sets for migration instructions. + ''; + } + ]; + systemd.packages = [ cfg.package ]; systemd.services.sing-box = {