diff --git a/modules/wsl-distro.nix b/modules/wsl-distro.nix index 78270fc6..e5254e58 100644 --- a/modules/wsl-distro.nix +++ b/modules/wsl-distro.nix @@ -215,7 +215,7 @@ in # require people to use lib.mkForce to make it harder to brick their installation wsl = { - populateBin = true; + populateBin = mkIf config.services.envfs.enable false; extraBin = [ { src = "/init"; name = "wslpath"; } { src = "${cfg.binShExe}"; name = "sh"; } @@ -223,6 +223,17 @@ in ]; }; + services.envfs.extraFallbackPathCommands = + concatStringsSep "\n" + (map + (entry: + if entry.copy + then "cp -f ${entry.src} $out/${entry.name}" + else "ln -sf ${entry.src} $out/${entry.name}" + ) + cfg.extraBin + ); + warnings = flatten [ (optional (config.services.resolved.enable && config.wsl.wslConf.network.generateResolvConf) "systemd-resolved is enabled, but resolv.conf is managed by WSL (wsl.wslConf.network.generateResolvConf)"