lib/vagrant-nixos/provisioner.rb
def write_config(filename, conf)
        temp = Tempfile.new("vagrant")
        temp.binmode
        temp.write(CONFIG_HEADER + conf)
        temp.close
        changed = true
        machine.communicate.tap do |comm|
          source = "/tmp/#{filename}"
          target = "/etc/nixos/#{filename}"
          comm.upload(temp.path, source)
          if same?(source, target)
            changed = false
          else
            comm.sudo("mv #{source} #{target}")
          end
        end
        return changed
      end
# Send file to machine.
# Returns true if the uploaded file if different from any
# preexisting file, false if the file is indentical
Send file to machine.
Returns true if the uploaded file if different from any
preexisting file, false if the file is indentical
Send file to machine . Returns true if the uploaded file if different from any preexisting file false if the file is indentical
def write_config(filename, conf)
        temp = Tempfile.new("vagrant")
        temp.binmode
        temp.write(CONFIG_HEADER + conf)
        temp.close
        changed = true
        machine.communicate.tap do |comm|
          source = "/tmp/#{filename}"
          target = "/etc/nixos/#{filename}"
          comm.upload(temp.path, source)
          if same?(source, target)
            changed = false
          else
            comm.sudo("mv #{source} #{target}")
          end
        end
        return changed
      end
def write_config ( filename , conf ) temp = Tempfile . new ( "vagrant" ) temp . binmode temp . write ( CONFIG_HEADER + conf ) temp . close changed = true machine . communicate . tap do | comm | source = "/tmp/#{filename}" target = "/etc/nixos/#{filename}" comm . upload ( temp . path , source ) if same? ( source , target ) changed = false else comm . sudo ( "mv #{source} #{target}" ) end end return changed end
Send file to machine.
Send file to machine .
filename
conf