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 $ appvm start chromium
$ # ... long wait for first time, because we need to collect a lot of packages $ # ... 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**. You can customize local settings in **~/.config/appvm/nix/local.nix**.
Default hotkey to release cursor: ctrl+alt. Default hotkey to release cursor: ctrl+alt.

View File

@ -327,6 +327,20 @@ func search(name string) {
return 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/" var configDir = os.Getenv("HOME") + "/.config/appvm/"
func main() { func main() {
@ -375,6 +389,8 @@ func main() {
searchCommand := kingpin.Command("search", "Search for application") searchCommand := kingpin.Command("search", "Search for application")
searchName := searchCommand.Arg("name", "Application name").Required().String() searchName := searchCommand.Arg("name", "Application name").Required().String()
kingpin.Command("sync", "Synchronize remote repos for applications")
switch kingpin.Parse() { switch kingpin.Parse() {
case "list": case "list":
list(l) list(l)
@ -390,5 +406,7 @@ func main() {
drop(*dropName) drop(*dropName)
case "autoballoon": case "autoballoon":
autoBalloon(l, *minMemory*1024, *adjustPercent) autoBalloon(l, *minMemory*1024, *adjustPercent)
case "sync":
sync()
} }
} }