diff --git a/artiq-fast/windows/autounattend.nix b/artiq-fast/windows/autounattend.nix index 7d65667..c2cfd23 100644 --- a/artiq-fast/windows/autounattend.nix +++ b/artiq-fast/windows/autounattend.nix @@ -39,17 +39,20 @@ let makeDirs = lib.mapAttrsToList (n: v: ''mkdir C:\Users\${n}\.ssh'') users; writeKeys = lib.flatten (lib.mapAttrsToList (n: v: builtins.map (key: let commands = [ - ''echo "${key}" | Out-File -FilePath C:\Users\${n}\.ssh\authorized_keys'' + ''powershell.exe "echo ${key} | Out-File -FilePath C:\Users\${n}\.ssh\authorized_keys"'' ]; in lib.concatStringsSep "\n" commands) (v.sshKeys or [])) users); - in makeDirs ++ writeKeys ++ [ + mkDirsDesc = builtins.map (c: {Path = c; Description = "Make SSH key dir";}) makeDirs; + writeKeysDesc = builtins.map (c: {Path = c; Description = "Add SSH key";}) writeKeys; + + in mkDirsDesc ++ writeKeysDesc ++ [ # TODO: Figure out how to do this step with sandboxing enabled { - Path = ''Register-PSRepository -Name "bootstraprepo" -SourceLocation F:\files''; + Path = ''Register-PSRepository -Name bootstraprepo -SourceLocation F:\files''; Description = "Local powershell repo import"; } { - Path = ''powershell.exe Install-Module -Repository "bootstraprepo" -Force OpenSSHUtils -Scope AllUsers''; + Path = ''powershell.exe Install-Module -Repository bootstraprepo -Force OpenSSHUtils -Scope AllUsers''; Description = "Install Openssh."; } { @@ -57,7 +60,7 @@ let Description = "Now start the sshd service."; } { - Path = ''powershell.exe Set-Service -Name sshd -StartupType "Automatic"''; + Path = ''powershell.exe Set-Service -Name sshd -StartupType Automatic''; Description = "Enable SSH by default."; } ];