From d90a2716bdc4513761510137bc2d7bb5c045f8de Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 27 Jan 2020 20:52:23 +0000 Subject: [PATCH] windows: Fix quoting issues in XML --- artiq-fast/windows/autounattend.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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."; } ];