diff --git a/Cargo.toml b/Cargo.toml
index 5ea21e57f2ce93535255988d07a559468e9ef6ba..81273c158418496b80a0e8bc30fb794251ce9bd4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -282,24 +282,19 @@ optional = true
 version = "1.16.0"
 optional = true
 
-
-[target.'cfg(not(unix))'.dependencies]
-tokio = { version = "1.36.0", features = [
+[dependencies.tokio]
+version = "1.36.0"
+features = [
   "fs",
   "macros",
   "sync",
-] } # tokio signals are not used on non-*nix platforms
+  "signal",
+]
 
 # *nix-specific dependencies
 [target.'cfg(unix)'.dependencies]
 nix = { version = "0.28.0", features = ["resource"] }
 sd-notify = { version = "0.4.1", optional = true } # systemd is only available/relevant on *nix platforms
-tokio = { version = "1.36.0", features = [
-  "fs",
-  "macros",
-  "sync",
-  "signal",
-] }
 hyperlocal = { git = "https://github.com/softprops/hyperlocal", rev = "2ee4d149644600d326559af0d2b235c945b05c04", features = ["server"] } # unix socket support
 
 
diff --git a/src/database/mod.rs b/src/database/mod.rs
index 774ca1869b94cecca808486348da3ac4fcaf1b37..22fd129e4ede9a0d417cc9b53c1aa105fe6da4aa 100644
--- a/src/database/mod.rs
+++ b/src/database/mod.rs
@@ -27,6 +27,8 @@
 	CanonicalJsonValue, EventId, OwnedDeviceId, OwnedEventId, OwnedRoomId, OwnedUserId, RoomId, UserId,
 };
 use serde::Deserialize;
+#[cfg(unix)]
+use tokio::signal::unix::{signal, SignalKind};
 use tokio::{
 	sync::mpsc,
 	time::{interval, Instant},
@@ -1083,9 +1085,6 @@ fn perform_cleanup() {
 
 	#[tracing::instrument]
 	async fn start_cleanup_task() {
-		#[cfg(unix)]
-		use tokio::signal::unix::{signal, SignalKind};
-
 		let timer_interval = Duration::from_secs(u64::from(services().globals.config.cleanup_second_interval));
 
 		tokio::spawn(async move {
diff --git a/src/main.rs b/src/main.rs
index db0939058fb958ad94a20fde987fee8b436a99f2..262fdf87c8feb61f2951fec8f59c37e19f166b62 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,6 @@
-use std::{
-	fs::Permissions, future::Future, io, net::SocketAddr, os::unix::fs::PermissionsExt, path::Path, sync::atomic,
-	time::Duration,
-};
+#[cfg(unix)]
+use std::os::unix::fs::PermissionsExt as _;
+use std::{fs::Permissions, future::Future, io, net::SocketAddr, path::Path, sync::atomic, time::Duration};
 
 use axum::{
 	extract::{DefaultBodyLimit, FromRequestParts, MatchedPath},
@@ -25,6 +24,7 @@
 	Method, StatusCode, Uri,
 };
 use hyper::Server;
+#[cfg(unix)]
 use hyperlocal::SocketIncoming;
 use ruma::api::{
 	client::{
@@ -35,10 +35,9 @@
 };
 #[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
 use tikv_jemallocator::Jemalloc;
-#[cfg(unix)]
-use tokio::signal;
 use tokio::{
-	sync::{oneshot, oneshot::Sender},
+	signal,
+	sync::oneshot::{self, Sender},
 	task::JoinSet,
 };
 use tower::ServiceBuilder;
@@ -730,21 +729,24 @@ async fn shutdown_signal(handle: ServerHandle, tx: Sender<()>) -> Result<()> {
 	#[cfg(unix)]
 	let terminate = async {
 		signal::unix::signal(signal::unix::SignalKind::terminate())
-			.expect("failed to install signal handler")
+			.expect("failed to install SIGTERM handler")
 			.recv()
 			.await;
 	};
 
-	#[cfg(not(unix))]
-	let terminate = std::future::pending::<()>();
-
 	let sig: &str;
 
+	#[cfg(unix)]
 	tokio::select! {
 		_ = ctrl_c => { sig = "Ctrl+C"; },
 		_ = terminate => { sig = "SIGTERM"; },
 	}
 
+	#[cfg(not(unix))]
+	tokio::select! {
+		_ = ctrl_c => { sig = "Ctrl+C"; },
+	}
+
 	warn!("Received {}, shutting down...", sig);
 	let shutdown_time_elapsed = tokio::time::Instant::now();
 	handle.graceful_shutdown(Some(Duration::from_secs(180)));