1 diff --git a/plugin/install/install.go b/plugin/install/install.go
2 index 60c61550..d7573c2d 100644
3 --- a/plugin/install/install.go
4 +++ b/plugin/install/install.go
5 @@ -151,6 +151,7 @@ func isOSCompatible(zipfile string) bool {
7 // InstallPluginFromZipFile installs plugin from given zip file
8 func InstallPluginFromZipFile(zipFile string, pluginName string) InstallResult {
9 + CheckForNixStore(fmt.Sprintf("Tried to install the plugin `%s`.", pluginName))
10 if !isPlatformIndependent(zipFile) && !isOSCompatible(zipFile) {
11 err := fmt.Errorf("provided plugin is not compatible with OS %s %s", runtime.GOOS, runtime.GOARCH)
12 return installError(err)
13 @@ -314,6 +315,7 @@ func runPlatformCommands(commands platformSpecificCommand, workingDir string) er
14 // UninstallPlugin uninstall the given plugin of the given uninstallVersion
15 // If uninstallVersion is not specified, it uninstalls all the versions of given plugin
16 func UninstallPlugin(pluginName string, uninstallVersion string) {
17 + CheckForNixStore(fmt.Sprintf("Tried to uninstall the plugin `%s`.", pluginName))
18 pluginsHome, err := common.GetPrimaryPluginsInstallDir()
20 logger.Fatalf(true, "Failed to uninstall plugin %s. %s", pluginName, err.Error())
21 @@ -518,6 +520,7 @@ func AllPlugins(silent, languageOnly bool) {
23 // UpdatePlugins updates all the currently installed plugins to its latest version
24 func UpdatePlugins(silent bool) {
25 + CheckForNixStore("Tried to update plugins")
26 var failedPlugin []string
27 pluginInfos, err := pluginInfo.GetPluginsInfo()
29 @@ -673,3 +676,21 @@ func AddPluginToProject(pluginName string) error {
30 logger.Infof(true, "Plugin %s was successfully added to the project\n", pluginName)
34 +func CheckForNixStore(message string) error {
35 + installDir, err := common.GetPrimaryPluginsInstallDir()
39 + if strings.HasPrefix(installDir, "/nix/store") {
41 + // check if we're installing in the sandbox
42 + if os.Getenv("NIX_GAUGE_IN_SANDBOX") == "true" {
45 + logger.Errorf(true, "%s\ngauge is installed with nix.\nPlease install plugins using nix or use the `gauge-unwrapped` package.", message)