mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-26 14:13:01 +00:00
Allow VMs with hostname other than default (#19)
The VM runner created by nix is called `./run-<hostname>-vm`. So far, the code hardcoded it as `./result/bin/run-nixos-vm`, but for the users that want to change VM hostname it may be problematic.
This commit is contained in:
parent
aaede60c4d
commit
a583335865
9
appvm.go
9
appvm.go
@ -133,8 +133,13 @@ func generateVM(path, name string, verbose bool) (realpath, reginfo, qcow2 strin
|
||||
return
|
||||
}
|
||||
|
||||
bytes, err := ioutil.ReadFile("result/bin/run-nixos-vm")
|
||||
if err != nil {
|
||||
matches, err := filepath.Glob("result/bin/run-*-vm")
|
||||
if err != nil || len(matches) != 1 {
|
||||
return
|
||||
}
|
||||
|
||||
bytes, err := ioutil.ReadFile(matches[0])
|
||||
if err != nil || len(matches) != 1 {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user