-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrantfile
37 lines (29 loc) · 1.04 KB
/
vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- mode: ruby -*-
# vi: set ft=ruby
Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.ssh.port = 2222
config.ssh.guest_port = 2222
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbehci", "on"]
vb.customize ["usbfilter", "add", "0", "--target", :id, "--name", "STLink", "--vendorid", "0x0483"]
end
# put host ssh keys onto VM
config.vm.provision "shell" do |s|
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
s.inline = <<-SHELL
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
SHELL
end
# run the provision script...
config.vm.provision "shell" do |s|
s.path = "./provision_box.sh"
s.keep_color = true
end
end
# A hack to make git not track custom.rb, ruby will
# run anything in backticks as a shell command
`git update-index --assume-unchanged custom.rb`
load "./custom.rb"