From 7e82318fd1e18f7f55b93e172bd9b63cce280d72 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 13 Feb 2020 00:52:45 +0000 Subject: [PATCH] Remove declarative SSH keys Windows changes the naming structure of homedir directories if it encounters an already present homedir so this is not working as intended. --- artiq-fast/windows/autounattend.nix | 25 +++++++++++++------------ artiq-fast/windows/build.nix | 3 --- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/artiq-fast/windows/autounattend.nix b/artiq-fast/windows/autounattend.nix index 614b1a1..302a3de 100644 --- a/artiq-fast/windows/autounattend.nix +++ b/artiq-fast/windows/autounattend.nix @@ -35,17 +35,18 @@ let ) ) services; - sshSetupCommands = let - makeDirs = lib.mapAttrsToList (n: v: ''mkdir C:\Users\${n}\.ssh'') users; - writeKeys = lib.flatten (lib.mapAttrsToList (n: v: builtins.map (key: let - commands = [ - ''powershell.exe Set-Content -Path C:\Users\${n}\.ssh\authorized_keys -Value '${key}' '' - ]; - in lib.concatStringsSep "\n" commands) (v.sshKeys or [])) users); - 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 ++ + sshSetupCommands = + # let + # makeDirs = lib.mapAttrsToList (n: v: ''mkdir C:\Users\${n}\.ssh'') users; + # writeKeys = lib.flatten (lib.mapAttrsToList (n: v: builtins.map (key: let + # commands = [ + # ''powershell.exe Set-Content -Path C:\Users\${n}\.ssh\authorized_keys -Value '${key}' '' + # ]; + # in lib.concatStringsSep "\n" commands) (v.sshKeys or [])) users); + # 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 ++ [ { Path = ''powershell.exe Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 -Source ${driveLetter}\fod -LimitAccess''; @@ -106,7 +107,7 @@ let , description ? "" , displayName ? "" , groups ? [] - , sshKeys ? [] # Handled in scripts + # , sshKeys ? [] # Handled in scripts }: '' diff --git a/artiq-fast/windows/build.nix b/artiq-fast/windows/build.nix index 1d62884..1d475f4 100644 --- a/artiq-fast/windows/build.nix +++ b/artiq-fast/windows/build.nix @@ -15,9 +15,6 @@ win.makeWindowsImage { # User accounts users = { artiq = { - # sshKeys = [ - # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmJW3Z+1ZNNVao2jcipQQxiEN27jtpl40fq3Je+jgir" - # ]; password = "1234"; # description = "Default user"; # displayName = "Display name";