Ensure WSL Ubuntu is installed

This commit is contained in:
Manuel Thalmann 2024-08-08 22:08:13 +02:00
parent e298767531
commit 6d371c9eae

View file

@ -79,8 +79,12 @@ $null = New-Module {
return;
}
if (-not (wsl --shell-type login type -t nix)) {
if (-not (& { $null = wsl -l; $?; })) {
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 --shutdown;
continue;