Implements update repos wrapper

This commit is contained in:
Mikhail Klementev 2020-01-02 15:47:42 +00:00
parent 6c72b5de00
commit af5691b0d4
No known key found for this signature in database
GPG key ID: BE44DA8C062D87DC
2 changed files with 22 additions and 0 deletions

View file

@ -55,6 +55,10 @@ You need to **relogin** if you install virt-manager (libvirt) first time.
$ appvm start chromium
$ # ... long wait for first time, because we need to collect a lot of packages
## Synchronize remote repos for applications
$ appvm sync
You can customize local settings in **~/.config/appvm/nix/local.nix**.
Default hotkey to release cursor: ctrl+alt.

View file

@ -327,6 +327,20 @@ func search(name string) {
return
}
func sync() {
err := exec.Command("nix-channel", "--update").Run()
if err != nil {
log.Fatalln(err)
}
err = exec.Command("nix", "search", "-u").Run()
if err != nil {
log.Fatalln(err)
}
log.Println("Done")
}
var configDir = os.Getenv("HOME") + "/.config/appvm/"
func main() {
@ -375,6 +389,8 @@ func main() {
searchCommand := kingpin.Command("search", "Search for application")
searchName := searchCommand.Arg("name", "Application name").Required().String()
kingpin.Command("sync", "Synchronize remote repos for applications")
switch kingpin.Parse() {
case "list":
list(l)
@ -390,5 +406,7 @@ func main() {
drop(*dropName)
case "autoballoon":
autoBalloon(l, *minMemory*1024, *adjustPercent)
case "sync":
sync()
}
}