diff --git a/plugins/hosts/void/cap/nfs.rb b/plugins/hosts/void/cap/nfs.rb new file mode 100644 index 000000000..a0d0fac91 --- /dev/null +++ b/plugins/hosts/void/cap/nfs.rb @@ -0,0 +1,19 @@ +module VagrantPlugins + module HostVoid + module Cap + class NFS + def self.nfs_check_command(env) + "/usr/bin/sv status nfs-server" + end + + def self.nfs_start_command(env) + "/usr/bin/sv up nfs-server " + end + + def self.nfs_installed(env) + Kernel.system("/usr/bin/xbps-query nfs-utils", [:out, :err] => "/dev/null") + end + end + end + end +end diff --git a/plugins/hosts/void/host.rb b/plugins/hosts/void/host.rb new file mode 100644 index 000000000..ea22c9b6a --- /dev/null +++ b/plugins/hosts/void/host.rb @@ -0,0 +1,22 @@ +require 'pathname' + +require 'vagrant' + +module VagrantPlugins + module HostVoid + class Host < Vagrant.plugin("2", :host) + def detect?(env) + os_file = Pathname.new("/etc/os-release") + + if os_file.exist? + file = os_file.open + while (line = file.gets) do + return true if line =~ /^ID="void"/ + end + end + + false + end + end + end +end diff --git a/plugins/hosts/void/plugin.rb b/plugins/hosts/void/plugin.rb new file mode 100644 index 000000000..4b297ab73 --- /dev/null +++ b/plugins/hosts/void/plugin.rb @@ -0,0 +1,30 @@ +require "vagrant" + +module VagrantPlugins + module HostVoid + class Plugin < Vagrant.plugin("2") + name "Void host" + description "Void linux host support." + + host("void", "linux") do + require_relative "host" + Host + end + + host_capability("void", "nfs_installed") do + require_relative "cap/nfs" + Cap::NFS + end + + host_capability("void", "nfs_check_command") do + require_relative "cap/nfs" + Cap::NFS + end + + host_capability("void", "nfs_start_command") do + require_relative "cap/nfs" + Cap::NFS + end + end + end +end