vscode-extension-update: Fix usage of experimental Nix features (#427027)

authored by Cosima Neidahl and committed by GitHub 8dfa050a 013a936c

+24 -3
+24 -3
pkgs/by-name/vs/vscode-extension-update/vscode_extension_update.py
··· 89 89 """ 90 90 Retrieves a raw Nix attribute value. 91 91 """ 92 - return self.execute_command(["nix", "eval", "--raw", "-f", ".", attribute_path]) 92 + return self.execute_command([ 93 + "nix", 94 + "--extra-experimental-features", 95 + "nix-command", 96 + "eval", 97 + "--raw", 98 + "-f", 99 + ".", 100 + attribute_path 101 + ]) 93 102 94 103 def get_nix_system(self) -> str: 95 104 """ 96 105 Retrieves system from Nix. 97 106 """ 98 - return self._get_nix_attribute("system") 107 + return self._get_nix_attribute("stdenv.hostPlatform.system") 99 108 100 109 def get_supported_nix_systems(self) -> list[str]: 101 - nix_config = self.execute_command(["nix", "config", "show"]) 110 + nix_config = self.execute_command([ 111 + "nix", 112 + "--extra-experimental-features", 113 + "nix-command", 114 + "config", 115 + "show" 116 + ]) 102 117 system = None 103 118 extra_platforms = [] 104 119 for line in nix_config.splitlines(): ··· 120 135 def _get_nix_vscode_extension_src_hash(self, system: str) -> str: 121 136 url = self.execute_command([ 122 137 "nix", 138 + "--extra-experimental-features", 139 + "nix-command", 123 140 "eval", 124 141 "--raw", 125 142 "-f", ··· 131 148 sha256 = self.execute_command(["nix-prefetch-url", url]) 132 149 return self.execute_command([ 133 150 "nix", 151 + "--extra-experimental-features", 152 + "nix-command", 134 153 "hash", 135 154 "convert", 136 155 "--to", ··· 183 202 return json.loads( 184 203 self.execute_command([ 185 204 "nix", 205 + "--extra-experimental-features", 206 + "nix-command", 186 207 "eval", 187 208 "--json", 188 209 "-f",