forked from M-Labs/nix-scripts
windows: Fix quoting issues in XML
This commit is contained in:
parent
a1e5d01f80
commit
d90a2716bd
|
@ -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.";
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue