From 95c05343ce292cd97c120f68131560947e25122c Mon Sep 17 00:00:00 2001 From: AmineChikhaoui Date: Thu, 31 May 2018 12:49:15 +0100 Subject: [PATCH 1/2] revert 4a86f8c9abd99b880b8a9c3609d330c7ff398ad5 and properly remove the temporary ssh host keys file/directory. --- nixos/modules/virtualisation/google-compute-image.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index 374a84332357..5957c95a86dd 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -253,11 +253,12 @@ in mv -f $SSH_HOST_KEYS_DIR/ssh_host_ed25519_key* /etc/ssh/ chmod 600 /etc/ssh/ssh_host_ed25519_key chmod 644 /etc/ssh/ssh_host_ed25519_key.pub + rm $SSH_HOST_KEYS_DIR/* else echo "Setup of ssh host keys from http://metadata.google.internal/computeMetadata/v1/instance/attributes/ failed." false fi - rm -f $SSH_HOST_KEYS_DIR + rm -r $SSH_HOST_KEYS_DIR ''; serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; From 1398d0c3128323f02e4e380c64bf817823a278c6 Mon Sep 17 00:00:00 2001 From: AmineChikhaoui Date: Mon, 4 Jun 2018 10:23:40 +0100 Subject: [PATCH 2/2] avoid redundant rm calls --- nixos/modules/virtualisation/google-compute-image.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index 5957c95a86dd..de2c43b8a40a 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -253,12 +253,11 @@ in mv -f $SSH_HOST_KEYS_DIR/ssh_host_ed25519_key* /etc/ssh/ chmod 600 /etc/ssh/ssh_host_ed25519_key chmod 644 /etc/ssh/ssh_host_ed25519_key.pub - rm $SSH_HOST_KEYS_DIR/* else echo "Setup of ssh host keys from http://metadata.google.internal/computeMetadata/v1/instance/attributes/ failed." false fi - rm -r $SSH_HOST_KEYS_DIR + rm -rf $SSH_HOST_KEYS_DIR ''; serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true;