From 7e8363552b626f322fd2e43aea20ab346739eef9 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:18:25 +0200 Subject: [PATCH] package/azure-cli-with-extensions: remove, use upstream `withExtensions` as overlay Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- overlays/nixpkgs.nix | 5 +++ .../azure-cli-with-extensions/package.nix | 32 ------------------- packages/scripts.nix | 6 ++-- 3 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 packages/by-name/azure-cli-with-extensions/package.nix diff --git a/overlays/nixpkgs.nix b/overlays/nixpkgs.nix index 316c69e44d..af1bbb01d6 100644 --- a/overlays/nixpkgs.nix +++ b/overlays/nixpkgs.nix @@ -14,4 +14,9 @@ final: prev: { hash = "sha256-N06oKyiexzjpaCZ8rFnH1f8YD5SSJQJUeEsgROkN9ak="; }; }); + + # Add the required extensions to the Azure CLI. + azure-cli = prev.azure-cli.withExtensions (with prev.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 dc99dde3b0..0000000000 --- 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 2c368f58ce..1bdf146271 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 = ''