Ensure WSL Ubuntu is installed

This commit is contained in:
Manuel Thalmann 2024-08-08 22:08:13 +02:00
parent 4b9ad41939
commit bbbbff7be4

View file

@ -80,8 +80,12 @@ $null = New-Module {
return; return;
} }
if (-not (wsl --shell-type login type -t nix)) { if (-not (& { $null = wsl -l; $?; })) {
ubuntu install --root; ubuntu install --root;
continue;
}
if (-not (wsl --shell-type login type -t nix)) {
wsl -- sh `<`(curl -L https://nixos.org/nix/install`) --daemon --yes; wsl -- sh `<`(curl -L https://nixos.org/nix/install`) --daemon --yes;
wsl --shutdown; wsl --shutdown;
continue; continue;