From 1b0fc045d51b8d25706b4aa323f4aeb9156e94cc Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 1 Aug 2024 14:06:40 +0200 Subject: [PATCH] Install WSL and `nix` by default --- scripts/Windows/OS/Install.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index c9621c6c..6ea9cec7 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -35,6 +35,8 @@ function Start-InstallationLoop { Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1; refreshenv; }; + + continue; } if (-not (Test-ChocoSoftware "powershell-core")) { @@ -53,8 +55,16 @@ function Start-InstallationLoop { if (Test-Path $env:PWSH_PATH) { attrib "-R" "$env:PWSH_PATH\*" /S /D; Remove-Item -Recurse -Force $env:PWSH_PATH; + continue; + } + + if (-not (& { wsl --status; $?; })) { + wsl --install --no-launch; + Restart-Intermediate; + return; } else { - Set-Stage ([SetupStage]::Install); + ubuntu install --root; + wsl -- sh `<`(curl -L https://nixos.org/nix/install`) --daemon --yes; } } else { $null = Import-Module PSWindowsUpdate;