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