diff --git a/overlays/nixpkgs.nix b/overlays/nixpkgs.nix index 316c69e44..fbe0a93f3 100644 --- a/overlays/nixpkgs.nix +++ b/overlays/nixpkgs.nix @@ -14,4 +14,11 @@ final: prev: { hash = "sha256-N06oKyiexzjpaCZ8rFnH1f8YD5SSJQJUeEsgROkN9ak="; }; }); + + # Add the required extensions to the Azure CLI. + azure-cli = prev.azure-cli.override { + withExtensions = with final.azure-cli.extensions; [ + aks-preview + ]; + }; } diff --git a/packages/by-name/azure-cli-with-extensions/package.nix b/packages/by-name/azure-cli-with-extensions/package.nix deleted file mode 100644 index dc99dde3b..000000000 --- a/packages/by-name/azure-cli-with-extensions/package.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ fetchurl -, python3 -, azure-cli -, symlinkJoin -}: -let - aks-preview = python3.pkgs.buildPythonPackage rec { - pname = "aks-preview"; - version = "0.5.173"; - format = "wheel"; - src = fetchurl { - url = "https://azcliprod.blob.core.windows.net/cli-extensions/aks_preview-0.5.173-py2.py3-none-any.whl"; - hash = "sha256-6BWX0CzL0oVrf9ljHjQU1jvmQiHXHGDcbhVIyVSH1u4="; - }; - postInstall = '' - ln -s $out/${python3.sitePackages} $out/${pname} - ''; - }; - - cliextensions = symlinkJoin { - name = "cliextensions"; - paths = [ aks-preview ]; - }; -in -azure-cli.overrideAttrs - (_oldAttrs: { - postFixup = '' - wrapProgram $out/bin/az \ - --set PYTHONPATH $PYTHONPATH \ - --set AZURE_EXTENSION_DIR ${cliextensions} - ''; - }) diff --git a/packages/scripts.nix b/packages/scripts.nix index 2c368f58c..1bdf14627 100644 --- a/packages/scripts.nix +++ b/packages/scripts.nix @@ -5,13 +5,13 @@ with pkgs; { create-coco-aks = writeShellApplication { name = "create-coco-aks"; - runtimeInputs = [ azure-cli-with-extensions ]; + runtimeInputs = [ azure-cli ]; text = builtins.readFile ./create-coco-aks.sh; }; destroy-coco-aks = writeShellApplication { name = "destroy-coco-aks"; - runtimeInputs = [ azure-cli-with-extensions ]; + runtimeInputs = [ azure-cli ]; text = builtins.readFile ./destroy-coco-aks.sh; }; @@ -228,7 +228,7 @@ with pkgs; get-azure-sku-locations = writeShellApplication { name = "get-azure-sku-locations"; runtimeInputs = [ - azure-cli-with-extensions + azure-cli jq ]; text = ''