mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2025-05-01 17:44:24 +00:00
Custom name for generate VMs
This commit is contained in:
parent
cc92ec3e23
commit
9c6b8a0122
2 changed files with 10 additions and 3 deletions
10
generate.go
10
generate.go
|
@ -42,7 +42,7 @@ func nixPath(name string) (path string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func generate(l *libvirt.Libvirt, name, bin string) {
|
||||
func generate(l *libvirt.Libvirt, name, bin, vmname string) {
|
||||
if !isPackageExists(name) {
|
||||
log.Println("Package pkgs."+name, "does not exists")
|
||||
return
|
||||
|
@ -88,7 +88,13 @@ func generate(l *libvirt.Libvirt, name, bin string) {
|
|||
}
|
||||
|
||||
realName := strings.Split(name, ".")[1]
|
||||
appFilename := configDir + "/nix/" + realName + ".nix"
|
||||
|
||||
var appFilename string
|
||||
if vmname != "" {
|
||||
appFilename = configDir + "/nix/" + vmname + ".nix"
|
||||
} else {
|
||||
appFilename = configDir + "/nix/" + realName + ".nix"
|
||||
}
|
||||
|
||||
appNixConfig := fmt.Sprintf(template, realName, bin)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue