@@ -7,12 +7,15 @@ import (
7
7
"context"
8
8
"errors"
9
9
"io/fs"
10
+ "path/filepath"
11
+ "runtime"
10
12
11
13
"github.com/sirupsen/logrus"
12
14
13
15
"github.com/lima-vm/lima/v2/pkg/envutil"
14
16
"github.com/lima-vm/lima/v2/pkg/limatype"
15
17
"github.com/lima-vm/lima/v2/pkg/limatype/dirnames"
18
+ "github.com/lima-vm/lima/v2/pkg/limatype/filenames"
16
19
"github.com/lima-vm/lima/v2/pkg/limayaml"
17
20
"github.com/lima-vm/lima/v2/pkg/registry"
18
21
"github.com/lima-vm/lima/v2/pkg/templatestore"
@@ -29,6 +32,9 @@ type LimaInfo struct {
29
32
VMTypesEx map [string ]DriverExt `json:"vmTypesEx"` // since Lima v2.0.0
30
33
GuestAgents map [limatype.Arch ]GuestAgent `json:"guestAgents"` // since Lima v1.1.0
31
34
ShellEnvBlock []string `json:"shellEnvBlock"`
35
+ HostOS string `json:"hostOS"` // since Lima v2.0.0
36
+ HostArch string `json:"hostArch"` // since Lima v2.0.0
37
+ IdentityFile string `json:"identityFile"` // since Lima v2.0.0
32
38
}
33
39
34
40
type DriverExt struct {
@@ -72,6 +78,8 @@ func New(ctx context.Context) (*LimaInfo, error) {
72
78
VMTypesEx : vmTypesEx ,
73
79
GuestAgents : make (map [limatype.Arch ]GuestAgent ),
74
80
ShellEnvBlock : envutil .GetDefaultBlockList (),
81
+ HostOS : runtime .GOOS ,
82
+ HostArch : limatype .NewArch (runtime .GOARCH ),
75
83
}
76
84
info .Templates , err = templatestore .Templates ()
77
85
if err != nil {
@@ -81,6 +89,11 @@ func New(ctx context.Context) (*LimaInfo, error) {
81
89
if err != nil {
82
90
return nil , err
83
91
}
92
+ configDir , err := dirnames .LimaConfigDir ()
93
+ if err != nil {
94
+ return nil , err
95
+ }
96
+ info .IdentityFile = filepath .Join (configDir , filenames .UserPrivateKey )
84
97
for _ , arch := range limatype .ArchTypes {
85
98
bin , err := usrlocalsharelima .GuestAgentBinary (limatype .LINUX , arch )
86
99
if err != nil {
0 commit comments