Stabilize Clash Verge DNS and autostart - #2
Merged
Conversation
martrtr
marked this pull request as ready for review
August 18, 2026 18:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
systemd-resolvedand let NetworkManager feed per-link DNS into it/etc/resolv.confnever becomes an empty resolvconf stub when Clash Verge/Mihomo is stopped or failsclash-verge-autostart.servicefromniri.servicetographical-session.targetso the GUI is started as part of the active graphical user sessionWhy
The current setup can leave
/etc/resolv.confwith no nameservers, which kills all hostname resolution even when the physical network is otherwise up. Clash Verge TUN itself is already enabled and the Mihomo/Meta firewall handling is already present, so those parts are intentionally left unchanged.Notes
The apparent
tun: falsevsenable_tun_mode: truemismatch in Clash Verge files is not treated as the root cause here: Clash Verge builds runtime Mihomo configuration from multiple files, and the seeded active profile already has TUN and DNS enabled.Validation
Compared against
main: onlymodules/core/default.nixandhome/mart/session-services.nixchange. The NixOSservices.resolvedmodule automatically switches NetworkManager DNS handling tosystemd-resolvedand owns/etc/resolv.conf, which is the intended integration path.