2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
2023-11-16 04:20:00 +00:00
|
|
|
, callPackage
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "2.56.0";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-08-22 20:05:09 +00:00
|
|
|
name = "azure-cli-${version}-src";
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "Azure";
|
|
|
|
repo = "azure-cli";
|
|
|
|
rev = "azure-cli-${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-rlyBp0aVjmOCIb000PdvU7nJlC9vvk+nVmIEtMTKEG8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# put packages that needs to be overridden in the py package scope
|
2023-11-16 04:20:00 +00:00
|
|
|
py = callPackage ./python-packages.nix { inherit src version; };
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
py.pkgs.toPythonApplication (py.pkgs.buildAzureCliPackage {
|
|
|
|
pname = "azure-cli";
|
|
|
|
inherit version src;
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
sourceRoot = "${src.name}/src/azure-cli";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2023-11-16 04:20:00 +00:00
|
|
|
antlr4-python3-runtime
|
|
|
|
applicationinsights
|
|
|
|
argcomplete
|
|
|
|
asn1crypto
|
2020-10-07 09:15:18 +00:00
|
|
|
azure-appconfiguration
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-batch
|
|
|
|
azure-cli-core
|
|
|
|
azure-cli-telemetry
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-common
|
|
|
|
azure-core
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-cosmos
|
2022-06-26 10:26:21 +00:00
|
|
|
azure-data-tables
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-datalake-store
|
|
|
|
azure-graphrbac
|
2020-10-07 09:15:18 +00:00
|
|
|
azure-keyvault-administration
|
2023-07-15 17:15:38 +00:00
|
|
|
azure-keyvault-certificates
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-keyvault-keys
|
2023-07-15 17:15:38 +00:00
|
|
|
azure-keyvault-secrets
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-loganalytics
|
|
|
|
azure-mgmt-advisor
|
|
|
|
azure-mgmt-apimanagement
|
|
|
|
azure-mgmt-appconfiguration
|
2023-07-15 17:15:38 +00:00
|
|
|
azure-mgmt-appcontainers
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-mgmt-applicationinsights
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-authorization
|
|
|
|
azure-mgmt-batch
|
|
|
|
azure-mgmt-batchai
|
|
|
|
azure-mgmt-billing
|
|
|
|
azure-mgmt-botservice
|
|
|
|
azure-mgmt-cdn
|
|
|
|
azure-mgmt-cognitiveservices
|
|
|
|
azure-mgmt-compute
|
|
|
|
azure-mgmt-consumption
|
|
|
|
azure-mgmt-containerinstance
|
|
|
|
azure-mgmt-containerregistry
|
|
|
|
azure-mgmt-containerservice
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-mgmt-core
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-cosmosdb
|
2021-01-05 17:05:55 +00:00
|
|
|
azure-mgmt-databoxedge
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-mgmt-datalake-nspkg
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-datalake-store
|
|
|
|
azure-mgmt-datamigration
|
|
|
|
azure-mgmt-devtestlabs
|
|
|
|
azure-mgmt-dns
|
|
|
|
azure-mgmt-eventgrid
|
|
|
|
azure-mgmt-eventhub
|
2021-07-14 22:03:04 +00:00
|
|
|
azure-mgmt-extendedlocation
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-hdinsight
|
|
|
|
azure-mgmt-imagebuilder
|
|
|
|
azure-mgmt-iotcentral
|
|
|
|
azure-mgmt-iothub
|
|
|
|
azure-mgmt-iothubprovisioningservices
|
|
|
|
azure-mgmt-keyvault
|
|
|
|
azure-mgmt-kusto
|
|
|
|
azure-mgmt-loganalytics
|
|
|
|
azure-mgmt-managementgroups
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-mgmt-managedservices
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-maps
|
|
|
|
azure-mgmt-marketplaceordering
|
|
|
|
azure-mgmt-media
|
|
|
|
azure-mgmt-monitor
|
|
|
|
azure-mgmt-msi
|
|
|
|
azure-mgmt-netapp
|
|
|
|
azure-mgmt-policyinsights
|
|
|
|
azure-mgmt-privatedns
|
|
|
|
azure-mgmt-rdbms
|
|
|
|
azure-mgmt-recoveryservices
|
|
|
|
azure-mgmt-recoveryservicesbackup
|
2020-05-03 17:38:23 +00:00
|
|
|
azure-mgmt-redhatopenshift
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-redis
|
|
|
|
azure-mgmt-relay
|
|
|
|
azure-mgmt-resource
|
|
|
|
azure-mgmt-search
|
|
|
|
azure-mgmt-security
|
|
|
|
azure-mgmt-servicebus
|
|
|
|
azure-mgmt-servicefabric
|
2021-05-20 23:08:51 +00:00
|
|
|
azure-mgmt-servicefabricmanagedclusters
|
2021-12-06 16:07:01 +00:00
|
|
|
azure-mgmt-servicelinker
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-sql
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-mgmt-signalr
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-sqlvirtualmachine
|
|
|
|
azure-mgmt-storage
|
2020-09-25 04:45:31 +00:00
|
|
|
azure-mgmt-synapse
|
2020-04-24 23:36:52 +00:00
|
|
|
azure-mgmt-trafficmanager
|
|
|
|
azure-mgmt-web
|
|
|
|
azure-multiapi-storage
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-nspkg
|
2023-10-09 19:29:22 +00:00
|
|
|
azure-storage-common
|
2023-11-16 04:20:00 +00:00
|
|
|
azure-storage-blob
|
2020-09-25 04:45:31 +00:00
|
|
|
azure-synapse-accesscontrol
|
2020-11-06 00:33:48 +00:00
|
|
|
azure-synapse-artifacts
|
2021-09-18 10:52:07 +00:00
|
|
|
azure-synapse-managedprivateendpoints
|
2020-09-25 04:45:31 +00:00
|
|
|
azure-synapse-spark
|
2023-11-16 04:20:00 +00:00
|
|
|
bcrypt
|
|
|
|
certifi
|
|
|
|
cffi
|
2022-06-26 10:26:21 +00:00
|
|
|
chardet
|
2020-04-24 23:36:52 +00:00
|
|
|
colorama
|
|
|
|
cryptography
|
2021-09-18 10:52:07 +00:00
|
|
|
distro
|
2023-03-15 16:39:30 +00:00
|
|
|
fabric
|
2023-11-16 04:20:00 +00:00
|
|
|
humanfriendly
|
|
|
|
idna
|
|
|
|
invoke
|
|
|
|
isodate
|
|
|
|
javaproperties
|
|
|
|
jinja2
|
|
|
|
jmespath
|
|
|
|
jsondiff
|
2020-04-24 23:36:52 +00:00
|
|
|
knack
|
2023-11-16 04:20:00 +00:00
|
|
|
markupsafe
|
|
|
|
msal-extensions
|
|
|
|
msal
|
|
|
|
msrest
|
|
|
|
msrestazure
|
|
|
|
oauthlib
|
|
|
|
packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
paramiko
|
2023-11-16 04:20:00 +00:00
|
|
|
pbr
|
|
|
|
pkginfo
|
|
|
|
portalocker
|
|
|
|
psutil
|
|
|
|
pycomposefile
|
|
|
|
pycparser
|
2023-03-15 16:39:30 +00:00
|
|
|
pygithub
|
2023-11-16 04:20:00 +00:00
|
|
|
pyjwt
|
2022-02-10 20:34:41 +00:00
|
|
|
pynacl
|
2020-04-24 23:36:52 +00:00
|
|
|
pyopenssl
|
2023-11-16 04:20:00 +00:00
|
|
|
python-dateutil
|
|
|
|
requests-oauthlib
|
2020-04-24 23:36:52 +00:00
|
|
|
requests
|
|
|
|
scp
|
2021-03-15 08:37:03 +00:00
|
|
|
semver
|
2020-04-24 23:36:52 +00:00
|
|
|
six
|
|
|
|
sshtunnel
|
2023-11-16 04:20:00 +00:00
|
|
|
tabulate
|
2020-04-24 23:36:52 +00:00
|
|
|
urllib3
|
2023-11-16 04:20:00 +00:00
|
|
|
wcwidth
|
2021-06-28 23:13:55 +00:00
|
|
|
websocket-client
|
2020-04-24 23:36:52 +00:00
|
|
|
xmltodict
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-05-03 20:48:10 +00:00
|
|
|
substituteInPlace az.completion.sh \
|
|
|
|
--replace register-python-argcomplete ${py.pkgs.argcomplete}/bin/register-python-argcomplete
|
2020-04-24 23:36:52 +00:00
|
|
|
installShellCompletion --bash --name az.bash az.completion.sh
|
|
|
|
installShellCompletion --zsh --name _az az.completion.sh
|
|
|
|
|
|
|
|
# remove garbage
|
|
|
|
rm $out/bin/az.bat
|
|
|
|
rm $out/bin/az.completion.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
# wrap the executable so that the python packages are available
|
|
|
|
# it's just a shebang script which calls `python -m azure.cli "$@"`
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/az \
|
|
|
|
--set PYTHONPATH $PYTHONPATH
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
|
|
|
|
$out/bin/az --version
|
|
|
|
$out/bin/az self-test
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# ensure these namespaces are able to be accessed
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"azure.batch"
|
|
|
|
"azure.cli.core"
|
|
|
|
"azure.cli.telemetry"
|
|
|
|
"azure.cosmos"
|
|
|
|
"azure.datalake.store"
|
|
|
|
"azure.graphrbac"
|
|
|
|
"azure.keyvault"
|
|
|
|
"azure.loganalytics"
|
|
|
|
"azure.mgmt.advisor"
|
|
|
|
"azure.mgmt.apimanagement"
|
|
|
|
"azure.mgmt.applicationinsights"
|
|
|
|
"azure.mgmt.appconfiguration"
|
2023-07-15 17:15:38 +00:00
|
|
|
"azure.mgmt.appcontainers"
|
2020-04-24 23:36:52 +00:00
|
|
|
"azure.mgmt.authorization"
|
|
|
|
"azure.mgmt.batch"
|
|
|
|
"azure.mgmt.batchai"
|
|
|
|
"azure.mgmt.billing"
|
|
|
|
"azure.mgmt.botservice"
|
|
|
|
"azure.mgmt.cdn"
|
|
|
|
"azure.mgmt.cognitiveservices"
|
|
|
|
"azure.mgmt.compute"
|
|
|
|
"azure.mgmt.consumption"
|
|
|
|
"azure.mgmt.containerinstance"
|
|
|
|
"azure.mgmt.containerregistry"
|
|
|
|
"azure.mgmt.containerservice"
|
|
|
|
"azure.mgmt.cosmosdb"
|
|
|
|
"azure.mgmt.datalake.store"
|
|
|
|
"azure.mgmt.datamigration"
|
|
|
|
"azure.mgmt.devtestlabs"
|
|
|
|
"azure.mgmt.dns"
|
|
|
|
"azure.mgmt.eventgrid"
|
|
|
|
"azure.mgmt.eventhub"
|
|
|
|
"azure.mgmt.hdinsight"
|
|
|
|
"azure.mgmt.imagebuilder"
|
|
|
|
"azure.mgmt.iotcentral"
|
|
|
|
"azure.mgmt.iothub"
|
|
|
|
"azure.mgmt.iothubprovisioningservices"
|
|
|
|
"azure.mgmt.keyvault"
|
|
|
|
"azure.mgmt.kusto"
|
|
|
|
"azure.mgmt.loganalytics"
|
|
|
|
"azure.mgmt.managedservices"
|
|
|
|
"azure.mgmt.managementgroups"
|
|
|
|
"azure.mgmt.maps"
|
|
|
|
"azure.mgmt.marketplaceordering"
|
|
|
|
"azure.mgmt.media"
|
|
|
|
"azure.mgmt.monitor"
|
|
|
|
"azure.mgmt.msi"
|
|
|
|
"azure.mgmt.netapp"
|
|
|
|
"azure.mgmt.policyinsights"
|
|
|
|
"azure.mgmt.privatedns"
|
|
|
|
"azure.mgmt.rdbms"
|
|
|
|
"azure.mgmt.recoveryservices"
|
|
|
|
"azure.mgmt.recoveryservicesbackup"
|
|
|
|
"azure.mgmt.redis"
|
|
|
|
"azure.mgmt.relay"
|
|
|
|
"azure.mgmt.resource"
|
|
|
|
"azure.mgmt.search"
|
|
|
|
"azure.mgmt.security"
|
|
|
|
"azure.mgmt.servicebus"
|
|
|
|
"azure.mgmt.servicefabric"
|
|
|
|
"azure.mgmt.signalr"
|
|
|
|
"azure.mgmt.sql"
|
|
|
|
"azure.mgmt.sqlvirtualmachine"
|
|
|
|
"azure.mgmt.storage"
|
|
|
|
"azure.mgmt.trafficmanager"
|
|
|
|
"azure.mgmt.web"
|
|
|
|
"azure.storage.blob"
|
|
|
|
"azure.storage.common"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/Azure/azure-cli";
|
|
|
|
description = "Next generation multi-platform command line experience for Azure";
|
2023-08-22 20:05:09 +00:00
|
|
|
downloadPage = "https://github.com/Azure/azure-cli/releases/tag/azure-cli-${version}";
|
|
|
|
longDescription = ''
|
|
|
|
The Azure Command-Line Interface (CLI) is a cross-platform
|
|
|
|
command-line tool to connect to Azure and execute administrative
|
|
|
|
commands on Azure resources. It allows the execution of commands
|
|
|
|
through a terminal using interactive command-line prompts or a script.
|
|
|
|
'';
|
|
|
|
changelog = "https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md";
|
|
|
|
sourceProvenance = [ sourceTypes.fromSource ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "az";
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ akechishiro jonringer ];
|
2023-08-22 20:05:09 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
})
|