-
Notifications
You must be signed in to change notification settings - Fork 8
/
Vagrantfile
100 lines (78 loc) · 4.85 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Vagrant.configure("2") do |config|
config.vm.define "linux" do |linux|
linux.vm.box = "archlinux/archlinux"
linux.vm.synced_folder ".", "/home/vagrant/sandpolis"
linux.vm.provider "virtualbox" do |virtualbox|
virtualbox.memory = 8192
virtualbox.cpus = 16
end
# Configure environment
linux.vm.provision :shell, :inline => "hostnamectl set-hostname sandpolis_linux && locale-gen en_US.UTF.8"
linux.vm.provision :shell, :inline => "pacman -Syu --noconfirm binutils gcc make git wget vim python-pip npm linux-headers"
# Install Java
linux.vm.provision :shell, :inline => "wget -q -O- https://download.java.net/java/early_access/panama/3/openjdk-17-panama+3-167_linux-x64_bin.tar.gz | tar zxf -"
linux.vm.provision :shell, :inline => "echo 'export JAVA_HOME=/home/vagrant/jdk-17' >>/home/vagrant/.bash_profile"
# Install Rust
linux.vm.provision :shell, :inline => "curl https://sh.rustup.rs -sSf | sh -s -- -y"
# Install Swift
linux.vm.provision :shell, :inline => "wget -q -O- https://swift.org/builds/swift-5.4.3-release/ubuntu2004/swift-5.4.3-RELEASE/swift-5.4.3-RELEASE-ubuntu20.04.tar.gz | tar zxf -"
linux.vm.provision :shell, :inline => "echo 'export PATH=\${PATH}:~/swift-5.4.3-RELEASE-ubuntu20.04/usr/bin' >>/home/vagrant/.bash_profile"
linux.vm.provision :shell, :inline => "source /home/vagrant/.bash_profile"
# Install protoc-gen-swift
#linux.vm.provision :shell, :inline => "git clone --depth 1 https://github.com/apple/swift-protobuf"
#linux.vm.provision :shell, :inline => "(cd swift-protobuf; swift build -c release; cp .build/release/protoc-gen-swift /usr/bin/protoc-gen-swift)"
# Install protoc-gen-rust
linux.vm.provision :shell, :inline => "git clone --depth 1 https://github.com/stepancheg/rust-protobuf"
linux.vm.provision :shell, :inline => "(cd rust-protobuf; cargo build --package protobuf-codegen --release; cp target/release/protoc-gen-rust /usr/bin/protoc-gen-rust)"
# Install formatters
linux.vm.provision :shell, :inline => "pacman -Syu --noconfirm python-black"
linux.vm.provision :shell, :inline => "npm install -g prettier"
end
config.vm.define "openbsd" do |openbsd|
openbsd.vm.box = "poad/openbsd"
openbsd.ssh.shell = "sh"
openbsd.vm.synced_folder ".", "/home/vagrant/sandpolis", type: "nfs"
# NFS needs host-only network
openbsd.vm.network :private_network, ip: "172.16.2.42"
openbsd.vm.provider "virtualbox" do |virtualbox|
virtualbox.memory = 8192
virtualbox.cpus = 16
end
end
config.vm.define "windows" do |windows|
windows.vm.box = "gusztavvargadr/windows-10"
windows.vm.synced_folder ".", "C:\\Users\\vagrant\\sandpolis"
windows.vm.provider "virtualbox" do |virtualbox|
virtualbox.memory = 8192
virtualbox.cpus = 16
end
# Configure environment
windows.vm.provision :shell, :inline => "choco install -y adoptopenjdk"
windows.vm.provision :shell, :inline => "choco install -y windows-sdk-10.0"
end
config.vm.define "macos" do |macos|
macos.vm.box = "yzgyyang/macOS-10.14"
macos.vm.synced_folder ".", "/vagrant",
id: "core",
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime,actimeo=1,resvport'],
:export_options => ['async,insecure,no_subtree_check,no_acl,no_root_squash']
# NFS needs host-only network
macos.vm.network :private_network, ip: "172.16.2.42"
macos.vm.provider "virtualbox" do |virtualbox|
virtualbox.memory = 8192
virtualbox.cpus = 16
virtualbox.customize ["modifyvm", :id, "--cpuid-set", "00000001", "000106e5", "00100800", "0098e3fd", "bfebfbff"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct", "MacBookPro11,3"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion", "1.0"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct", "Iloveapple"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/DeviceKey", "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC", "1"]
virtualbox.customize ["setextradata", :id, "VBoxInternal2/EfiGopMode", "4"]
end
macos.vm.provision :shell, :inline => "brew install --cask adoptopenjdk"
# Install Xcode
#macos.vm.provision :shell, :inline => "gem install xcode-install"
#macos.vm.provision :shell, :inline => "xcversion install"
end
end