lima-vm / lima-vm/lima

Make host information available in templates

Open
#4,560 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

Hi all,

thanks for this awesome tool!

To give a little bit of context first: I'm using lima to provision CI agents on my MacStudio and my Linux desktop.
I'm using the same template for both machines, because the CI agent should have the same capabilities for both systems, the main difference is that the Mac runs on a ARM64 architecture and the Linux on desktop x86_64 architecture.

I saw, that there is already an issue ( #3993 ) that goes into a similar direction, that it would be great to be able to query certain driver/host facts in a template, to be able to switch certain behavior.

I propose to go one step further and not only expose certain driver features but also

- OS
- architecture
- CPU core count
- Total memory in MB
- hostname
- ???

via something like `{{ .host. }}`

This would make it a lot easier to dynamically adapt the template to the host.

The challenges I'm currently facing are:

- on Linux I need to fallback to legacy BIOS
- scripts to install software have to check for the host CPU architecture and incorporate the current architecture in the URL
- depending on the host, I've to reduce the size (CPU cores and memory) of the VM
- probably I'm forgetting something 😅

If that is something you would consider I'd be happy to also create a PR for it of course :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.