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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile("result/bin/run-nixos-vm")
|
matches, err := filepath.Glob("result/bin/run-*-vm")
|
||||||
if err != nil {
|
if err != nil || len(matches) != 1 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
bytes, err := ioutil.ReadFile(matches[0])
|
||||||
|
if err != nil || len(matches) != 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user