Skip to content

Commit

Permalink
fix: use temporary install key generated with ssh-keygen -t ed25519
Browse files Browse the repository at this point in the history
… to fix nix-community#74

chore: urls to latest ISOs with existing iso_urls_update.rb script
  • Loading branch information
k2s committed Jan 10, 2022
1 parent a64dea2 commit b526142
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 69 deletions.
6 changes: 3 additions & 3 deletions gen_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def builder(**opts)
boot_command: [
'echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>',
'mkdir -m 0700 .ssh<enter>',
'curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>',
'curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>',
'sudo systemctl start sshd<enter>',
],
http_directory: 'scripts',
shutdown_command: 'sudo shutdown -h now',
ssh_private_key_file: './scripts/install_rsa',
ssh_private_key_file: './scripts/install_key',
ssh_port: 22,
ssh_username: 'nixos',
headless: true
Expand Down Expand Up @@ -91,7 +91,7 @@ def gen_template(
boot_command: [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
# remaining commands run as root
"sudo su --<enter>",
"nix-env -iA nixos.linuxPackages.hyperv-daemons<enter><wait10>",
Expand Down
8 changes: 4 additions & 4 deletions iso_urls.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"x86_64": {
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-x86_64-linux.iso",
"iso_sha256": "7fec8949043bca97c6930177af868532219aa4037017f2f6122094035eeafb1c"
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-x86_64-linux.iso",
"iso_sha256": "7cb910f01993cdbbaae87ab54e5317be28a268c0ef71f6c919ab759f2a9f00e2"
},
"i686": {
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-i686-linux.iso",
"iso_sha256": "3ef4743ded79c72d91a6f71d06f9868c62c769a99ca79e398869a7f02b8bcb14"
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-i686-linux.iso",
"iso_sha256": "9bb6469fa944045d20d82e66f74dee037cb868a4b9a4f0e6f76df1e304a23579"
}
}
34 changes: 17 additions & 17 deletions nixos-i686.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "virtualbox-iso",
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-i686-linux.iso",
"iso_checksum": "3ef4743ded79c72d91a6f71d06f9868c62c769a99ca79e398869a7f02b8bcb14",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-i686-linux.iso",
"iso_checksum": "9bb6469fa944045d20d82e66f74dee037cb868a4b9a4f0e6f76df1e304a23579",
"guest_additions_mode": "disable",
"format": "ova",
"guest_os_type": "Linux",
Expand All @@ -43,18 +43,18 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "qemu",
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-i686-linux.iso",
"iso_checksum": "3ef4743ded79c72d91a6f71d06f9868c62c769a99ca79e398869a7f02b8bcb14",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-i686-linux.iso",
"iso_checksum": "9bb6469fa944045d20d82e66f74dee037cb868a4b9a4f0e6f76df1e304a23579",
"disk_interface": "virtio-scsi",
"disk_size": "{{ user `disk_size` }}",
"format": "qcow2",
Expand All @@ -70,22 +70,22 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo su --<enter>",
"nix-env -iA nixos.linuxPackages.hyperv-daemons<enter><wait10>",
"$(find /nix/store -executable -iname 'hv_kvp_daemon' | head -n 1)<enter><wait10>",
"systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "hyperv-iso",
"generation": 1,
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-i686-linux.iso",
"iso_checksum": "3ef4743ded79c72d91a6f71d06f9868c62c769a99ca79e398869a7f02b8bcb14",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-i686-linux.iso",
"iso_checksum": "9bb6469fa944045d20d82e66f74dee037cb868a4b9a4f0e6f76df1e304a23579",
"memory": "{{ user `memory` }}",
"disk_size": "{{ user `disk_size` }}",
"enable_secure_boot": false,
Expand All @@ -99,18 +99,18 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "vmware-iso",
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-i686-linux.iso",
"iso_checksum": "3ef4743ded79c72d91a6f71d06f9868c62c769a99ca79e398869a7f02b8bcb14",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-i686-linux.iso",
"iso_checksum": "9bb6469fa944045d20d82e66f74dee037cb868a4b9a4f0e6f76df1e304a23579",
"memory": "{{ user `memory` }}",
"disk_size": "{{ user `disk_size` }}",
"guest_os_type": "Linux"
Expand All @@ -133,7 +133,7 @@
"qemu",
"hyperv-iso"
],
"output": "nixos-21.05-{{.Provider}}-i686.box"
"output": "nixos-21.11-{{.Provider}}-i686.box"
}
]
]
Expand Down
34 changes: 17 additions & 17 deletions nixos-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "virtualbox-iso",
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-x86_64-linux.iso",
"iso_checksum": "7fec8949043bca97c6930177af868532219aa4037017f2f6122094035eeafb1c",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-x86_64-linux.iso",
"iso_checksum": "7cb910f01993cdbbaae87ab54e5317be28a268c0ef71f6c919ab759f2a9f00e2",
"guest_additions_mode": "disable",
"format": "ova",
"guest_os_type": "Linux_64",
Expand All @@ -43,18 +43,18 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "qemu",
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-x86_64-linux.iso",
"iso_checksum": "7fec8949043bca97c6930177af868532219aa4037017f2f6122094035eeafb1c",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-x86_64-linux.iso",
"iso_checksum": "7cb910f01993cdbbaae87ab54e5317be28a268c0ef71f6c919ab759f2a9f00e2",
"disk_interface": "virtio-scsi",
"disk_size": "{{ user `disk_size` }}",
"format": "qcow2",
Expand All @@ -70,22 +70,22 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo su --<enter>",
"nix-env -iA nixos.linuxPackages.hyperv-daemons<enter><wait10>",
"$(find /nix/store -executable -iname 'hv_kvp_daemon' | head -n 1)<enter><wait10>",
"systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "hyperv-iso",
"generation": 1,
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-x86_64-linux.iso",
"iso_checksum": "7fec8949043bca97c6930177af868532219aa4037017f2f6122094035eeafb1c",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-x86_64-linux.iso",
"iso_checksum": "7cb910f01993cdbbaae87ab54e5317be28a268c0ef71f6c919ab759f2a9f00e2",
"memory": "{{ user `memory` }}",
"disk_size": "{{ user `disk_size` }}",
"enable_secure_boot": false,
Expand All @@ -99,18 +99,18 @@
"boot_command": [
"echo http://{{ .HTTPIP }}:{{ .HTTPPort}} > .packer_http<enter>",
"mkdir -m 0700 .ssh<enter>",
"curl $(cat .packer_http)/install_rsa.pub > .ssh/authorized_keys<enter>",
"curl $(cat .packer_http)/install_key.pub > .ssh/authorized_keys<enter>",
"sudo systemctl start sshd<enter>"
],
"http_directory": "scripts",
"shutdown_command": "sudo shutdown -h now",
"ssh_private_key_file": "./scripts/install_rsa",
"ssh_private_key_file": "./scripts/install_key",
"ssh_port": 22,
"ssh_username": "nixos",
"headless": true,
"type": "vmware-iso",
"iso_url": "https://releases.nixos.org/nixos/21.05/nixos-21.05.3443.ee90403e147/nixos-minimal-21.05.3443.ee90403e147-x86_64-linux.iso",
"iso_checksum": "7fec8949043bca97c6930177af868532219aa4037017f2f6122094035eeafb1c",
"iso_url": "https://channels.nixos.org/nixos-21.11/latest-nixos-minimal-x86_64-linux.iso",
"iso_checksum": "7cb910f01993cdbbaae87ab54e5317be28a268c0ef71f6c919ab759f2a9f00e2",
"memory": "{{ user `memory` }}",
"disk_size": "{{ user `disk_size` }}",
"guest_os_type": "Linux"
Expand All @@ -133,7 +133,7 @@
"qemu",
"hyperv-iso"
],
"output": "nixos-21.05-{{.Provider}}-x86_64.box"
"output": "nixos-21.11-{{.Provider}}-x86_64.box"
}
]
]
Expand Down
7 changes: 7 additions & 0 deletions scripts/install_key
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACC1xMAfsqkzJyaukX4ykynPCEtFTS+fLdd4duufnVuJUwAAAJDCDGZlwgxm
ZQAAAAtzc2gtZWQyNTUxOQAAACC1xMAfsqkzJyaukX4ykynPCEtFTS+fLdd4duufnVuJUw
AAAEC8f9HrVwq+PG/tyH3+7SjG600qHQ5rX6MWICc8w5RplrXEwB+yqTMnJq6RfjKTKc8I
S0VNL58t13h265+dW4lTAAAAB2syc0BrMm4BAgMEBQY=
-----END OPENSSH PRIVATE KEY-----
1 change: 1 addition & 0 deletions scripts/install_key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILXEwB+yqTMnJq6RfjKTKc8IS0VNL58t13h265+dW4lT nixos@install.local
27 changes: 0 additions & 27 deletions scripts/install_rsa

This file was deleted.

1 change: 0 additions & 1 deletion scripts/install_rsa.pub

This file was deleted.

0 comments on commit b526142

Please sign in to comment.