feat: tor keep awake

This commit is contained in:
fufsob committed 2026-10-12 03:24:23 +00:00
1 parent 7d96e7c6f8
commit 2be98214ed
5 files changed
+33

No files matched your search

+11
View File
@@ -56,6 +56,17 @@ in
'';
};
keepAwake = mkOption {
type = types.bool;
default = false;
description = ''
Never let Tor go dormant. By default it does after a day without use, and from then on
only rebuilds its circuits when the next connection comes: the first .onion after a quiet
spell may wait long enough to fail. Turn on where clients expect .onion at once, as on a
server whose inbounds route it. A dormant Tor also starts dormant again; this wakes it.
'';
};
upstream = mkOption {
type = types.enum [
"direct"
+4
View File
@@ -89,6 +89,10 @@ let
"CookieAuthentication 0"
]
++ lib.optional t.clientOnly "ClientOnly 1"
++ lib.optionals t.keepAwake [
"DormantTimeoutEnabled 0"
"DormantCanceledByStartup 1"
]
++ (if t.asOutbound then [ "SocksPort 127.0.0.1:${toString t.socksPort}" ] else [ "SocksPort 0" ])
++ lib.optionals bridgesEnabled [
"UseBridges 1"