From f542f318ccae8d4e2ad3418e936cf2f148a71c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 26 Mar 2023 23:53:03 +0200 Subject: [PATCH] wsl-conf: warn when networking.extraHosts has no effect --- modules/wsl-conf.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/wsl-conf.nix b/modules/wsl-conf.nix index 4985ca7e..0058f29b 100644 --- a/modules/wsl-conf.nix +++ b/modules/wsl-conf.nix @@ -85,9 +85,10 @@ with lib; { environment.etc."wsl.conf".text = generators.toINI { } config.wsl.wslConf; - warnings = (optional (config.wsl.wslConf.boot.systemd && !config.wsl.nativeSystemd) - "systemd is enabled in wsl.conf, but wsl.nativeSystemd is not enabled. Unless you did this on purpos, this WILL make your system UNBOOTABLE!" - ); + warnings = optional (config.wsl.wslConf.boot.systemd && !config.wsl.nativeSystemd) + "systemd is enabled in wsl.conf, but wsl.nativeSystemd is not enabled. Unless you did this on purpose, this WILL make your system UNBOOTABLE!" + ++ optional (config.wsl.wslConf.network.generateHosts && config.networking.extraHosts != "") + "networking.extraHosts has no effect if wsl.wslConf.network.generateHosts is true."; };