nixos/clash-verge: enable serviceModule by default (#363005)

Changed files
+21 -8
nixos
doc
manual
release-notes
modules
programs
+2
nixos/doc/manual/release-notes/rl-2505.section.md
···
- `zf` was updated to 0.10.2, which includes breaking changes from the [0.10.0 release](https://github.com/natecraddock/zf/releases/tag/0.10.0).
`zf` no longer does Unicode normalization of the input and no longer supports terminal escape sequences in the `ZF_PROMPT` environment variable.
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
## Other Notable Changes {#sec-release-25.05-notable-changes}
···
- `zf` was updated to 0.10.2, which includes breaking changes from the [0.10.0 release](https://github.com/natecraddock/zf/releases/tag/0.10.0).
`zf` no longer does Unicode normalization of the input and no longer supports terminal escape sequences in the `ZF_PROMPT` environment variable.
+
- `programs.clash-verge.tunMode` was deprecated and removed because now service mode is neccessary to start program. Without `programs.clash-verge.enable`, clash-verge-rev will refuse to start.
+
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
## Other Notable Changes {#sec-release-25.05-notable-changes}
+19 -8
nixos/modules/programs/clash-verge.nix
···
}:
{
options.programs.clash-verge = {
enable = lib.mkEnableOption "Clash Verge";
package = lib.mkOption {
···
clash-verge-rev and clash-nyanpasu, both are forks of
the original clash-verge project.
'';
-
example = "pkgs.clash-verge-rev";
};
autoStart = lib.mkEnableOption "Clash Verge auto launch";
-
tunMode = lib.mkEnableOption "Clash Verge TUN mode";
};
config =
···
))
];
-
security.wrappers.clash-verge = lib.mkIf cfg.tunMode {
-
owner = "root";
-
group = "root";
-
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
-
source = "${lib.getExe cfg.package}";
};
};
-
meta.maintainers = with lib.maintainers; [ zendo ];
}
···
}:
{
+
imports = [
+
(lib.mkRemovedOptionModule [ "programs" "clash-verge" "tunMode" ] ''
+
The tunMode will work with service mode which is enabled by default.
+
'')
+
];
options.programs.clash-verge = {
enable = lib.mkEnableOption "Clash Verge";
package = lib.mkOption {
···
clash-verge-rev and clash-nyanpasu, both are forks of
the original clash-verge project.
'';
+
default = pkgs.clash-verge-rev;
+
defaultText = lib.literalExpression "pkgs.clash-verge-rev";
};
autoStart = lib.mkEnableOption "Clash Verge auto launch";
};
config =
···
))
];
+
systemd.services.clash-verge = {
+
enable = true;
+
description = "Clash Verge Service Mode";
+
serviceConfig = {
+
ExecStart = "${cfg.package}/bin/clash-verge-service";
+
Restart = "on-failure";
+
};
+
wantedBy = [ "multi-user.target" ];
};
};
+
meta.maintainers = with lib.maintainers; [
+
bot-wxt1221
+
Guanran928
+
];
}