abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
17.73k stars 364 forks source link

Start colima without rewriting `colima.yaml` config #1004

Open stackptr opened 3 months ago

stackptr commented 3 months ago

Description

I want to use NixOS to manage the colima.yaml config for the default profile. NixOS will build a YAML File in a read-only filesystem and creates a symlink to it in the expected path. This fails because colima requires write permissions:

❯ colima start -p default --very-verbose
TRAC[0000] cmd ["limactl" "info"]                       
TRAC[0000] cmd ["system_profiler" "-json" "SPHardwareDataType"] 
TRAC[0000] cmd ["system_profiler" "-json" "SPHardwareDataType"] 
FATA[0000] error preparing config file: error writing yaml file: open /Users/corey/.colima/default/colima.yaml: permission denied 

When I move the symlink and copy the contents to the path, it seems that a template is used to write a new configuration file with the values of whatever was read in on startup. While it is great that this allows poorly formatted files to be legible after startup, I'd like a way to tell colima that this unnecessary. For example, colima start --no-config-template or --read-only-config.