jollheef / appvm

Nix-based app VMs
GNU General Public License v3.0
252 stars 18 forks source link

Configuration file #21

Open jollheef opened 4 years ago

jollheef commented 4 years ago

There are some command line (e.g. --min-memory and --adj-memory for autoballooning, also --networking-model in #20) switches that are better to have also in the configuration file that not introduced yet.

So the idea is to have a configuration file that will set all Default("...") in parameters for kingpin.

msm-code commented 4 years ago

:+1: I also thought about it.

What do you think about (additional?) per-VM configuration? For example some VMs are much more lightweight than the others (for example most terminal apps don't use minimal 1GiB ram). Or there are some VMs that I always want to run in offline mode.

jollheef commented 4 years ago

We can make it something like that (https://github.com/toml-lang/toml), using the name of the file for configuration for matching.

# https://github.com/toml-lang/toml
minimal_memory = 1024
adj_memory = 20

[[vm]]
# set configuration for ~/.config/appvm/nix/chromium.nix
name = "chromium" 
minimal_memory = 100500

[[vm]]
 # set configuration for ~/.config/appvm/nix/evince.nix
name = "evince"
offline = true

Looks easy and convenient.