From 66abdc297d7c5e2c3624c8d8b8efd45335caf701 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 | 7 ++++ .../azure-cli-with-extensions/package.nix | 32 ------------------- packages/scripts.nix | 6 ++-- 3 files changed, 10 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 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 = ''