File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,10 @@ var nixPlatforms = []string{
182
182
"armv7l-linux" ,
183
183
}
184
184
185
+ func SupportedPlatforms () []string {
186
+ return nixPlatforms
187
+ }
188
+
185
189
// EnsureValidPlatform returns an error if the platform is not supported by nix.
186
190
// https://nixos.org/manual/nix/stable/installation/supported-platforms.html
187
191
func EnsureValidPlatform (platform string ) error {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
13
13
14
14
"github.com/fatih/color"
15
15
"github.com/pkg/errors"
16
+ "github.com/samber/lo"
16
17
"go.jetpack.io/devbox/internal/boxcli/usererr"
17
18
"go.jetpack.io/devbox/internal/devpkg"
18
19
"go.jetpack.io/devbox/internal/lock"
@@ -265,9 +266,22 @@ func ProfileInstall(args *ProfileInstallArgs) error {
265
266
if exists , err := input .ValidateInstallsOnSystem (); err != nil {
266
267
return err
267
268
} else if ! exists {
269
+ platform , err := nix .System ()
270
+ if err != nil {
271
+ platform = ""
272
+ } else {
273
+ platform = " " + platform
274
+ }
275
+ otherPlatforms := lo .Filter (nix .SupportedPlatforms (), func (p string , _ int ) bool {
276
+ return p != platform
277
+ })
268
278
return usererr .New (
269
- "package %s cannot be installed on your system. It may be installable on other systems." ,
279
+ "package %s cannot be installed on your platform%s. " +
280
+ "Consider using `--platform` or `--exclude-platform` with `devbox add` to install on a supported" +
281
+ " platform. Other available platforms are: %s." ,
270
282
input .String (),
283
+ platform ,
284
+ strings .Join (otherPlatforms , ", " ),
271
285
)
272
286
}
273
287
}
You can’t perform that action at this time.
0 commit comments