nixos/sing-box: add assertions for deprecated geoip and geosite options
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user