2023-09-29 00:38:38 +02:00
|
|
|
{ lib
|
2023-10-26 20:18:30 +02:00
|
|
|
, callPackage
|
2023-09-29 00:38:38 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2019-10-23 12:07:42 +02:00
|
|
|
|
|
|
|
let
|
2023-12-08 09:27:56 +01:00
|
|
|
version = "2.55.0";
|
2021-01-28 04:54:52 +01:00
|
|
|
|
2019-10-23 12:07:42 +02:00
|
|
|
src = fetchFromGitHub {
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 19:18:01 +02:00
|
|
|
name = "azure-cli-${version}-src";
|
2019-10-23 12:07:42 +02:00
|
|
|
owner = "Azure";
|
|
|
|
repo = "azure-cli";
|
|
|
|
rev = "azure-cli-${version}";
|
2023-12-08 09:27:56 +01:00
|
|
|
hash = "sha256-+4ju+KOQ9LG1nzYnHOZ4mvXf6SazcrIgw/Q2mvetPMc=";
|
2019-10-23 12:07:42 +02:00
|
|
|
};
|
|
|
|
|
2022-12-18 01:39:44 +01:00
|
|
|
# put packages that needs to be overridden in the py package scope
|
2023-10-26 20:18:30 +02:00
|
|
|
py = callPackage ./python-packages.nix { inherit src version; };
|
2019-10-23 12:07:42 +02:00
|
|
|
in
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 19:18:01 +02:00
|
|
|
|
2019-10-23 12:07:42 +02:00
|
|
|
py.pkgs.toPythonApplication (py.pkgs.buildAzureCliPackage {
|
|
|
|
pname = "azure-cli";
|
|
|
|
inherit version src;
|
|
|
|
|
treewide: noop: refer to `src.name` or similar where appropriate, part 3: more use cases
This continues where d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e left off. Similarly
to that commit, this commit this also points `sourceRoot`s to `src.name` and similar
instead of keeping hardcoded names, and edits other derivation attrs do do the same,
where appropriate.
Also, similarly to d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e some of expressions this
edits use `srcs` attribute with customly-named sources, so they have to be moved
into `let` blocks to keep evaluation efficient (the other, worse, way to do this
would to recurcively refer to `elemAt n finalAttrs.srcs` or, similarly, with `rec`).
2023-08-08 19:18:01 +02:00
|
|
|
sourceRoot = "${src.name}/src/azure-cli";
|
2019-10-23 12:07:42 +02:00
|
|
|
|
2023-09-29 00:38:38 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2019-10-23 12:07:42 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2023-10-27 08:30:24 +02:00
|
|
|
antlr4-python3-runtime
|
|
|
|
applicationinsights
|
|
|
|
argcomplete
|
|
|
|
asn1crypto
|
2020-09-28 20:13:29 +02:00
|
|
|
azure-appconfiguration
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-batch
|
|
|
|
azure-cli-core
|
|
|
|
azure-cli-telemetry
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-common
|
|
|
|
azure-core
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-cosmos
|
2022-06-07 01:13:10 +02:00
|
|
|
azure-data-tables
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-datalake-store
|
|
|
|
azure-graphrbac
|
2020-09-28 20:13:29 +02:00
|
|
|
azure-keyvault-administration
|
2023-04-18 00:29:20 +02:00
|
|
|
azure-keyvault-certificates
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-keyvault-keys
|
2023-04-18 00:29:20 +02:00
|
|
|
azure-keyvault-secrets
|
2019-12-01 23:28:29 +01:00
|
|
|
azure-loganalytics
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-advisor
|
|
|
|
azure-mgmt-apimanagement
|
|
|
|
azure-mgmt-appconfiguration
|
2023-04-18 00:29:20 +02:00
|
|
|
azure-mgmt-appcontainers
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-mgmt-applicationinsights
|
2019-10-23 12:07:42 +02: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-10-27 08:30:24 +02:00
|
|
|
azure-mgmt-core
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-cosmosdb
|
2020-12-30 23:33:08 +01:00
|
|
|
azure-mgmt-databoxedge
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-mgmt-datalake-nspkg
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-datalake-store
|
|
|
|
azure-mgmt-datamigration
|
|
|
|
azure-mgmt-devtestlabs
|
|
|
|
azure-mgmt-dns
|
|
|
|
azure-mgmt-eventgrid
|
|
|
|
azure-mgmt-eventhub
|
2021-07-08 22:34:22 +02:00
|
|
|
azure-mgmt-extendedlocation
|
2019-10-23 12:07:42 +02: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-10-27 08:30:24 +02:00
|
|
|
azure-mgmt-managedservices
|
2019-10-23 12:07:42 +02: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-04-23 02:01:49 +02:00
|
|
|
azure-mgmt-redhatopenshift
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-redis
|
|
|
|
azure-mgmt-relay
|
|
|
|
azure-mgmt-resource
|
|
|
|
azure-mgmt-search
|
|
|
|
azure-mgmt-security
|
|
|
|
azure-mgmt-servicebus
|
|
|
|
azure-mgmt-servicefabric
|
2021-05-06 08:46:40 +02:00
|
|
|
azure-mgmt-servicefabricmanagedclusters
|
2021-11-21 00:16:12 +01:00
|
|
|
azure-mgmt-servicelinker
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-sql
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-mgmt-signalr
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-sqlvirtualmachine
|
|
|
|
azure-mgmt-storage
|
2020-09-02 22:56:54 +02:00
|
|
|
azure-mgmt-synapse
|
2019-10-23 12:07:42 +02:00
|
|
|
azure-mgmt-trafficmanager
|
|
|
|
azure-mgmt-web
|
|
|
|
azure-multiapi-storage
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-nspkg
|
2023-09-29 00:38:38 +02:00
|
|
|
azure-storage-common
|
2023-10-27 08:30:24 +02:00
|
|
|
azure-storage-blob
|
2020-09-02 22:56:54 +02:00
|
|
|
azure-synapse-accesscontrol
|
2020-11-02 18:45:29 +01:00
|
|
|
azure-synapse-artifacts
|
2021-09-12 03:43:54 +02:00
|
|
|
azure-synapse-managedprivateendpoints
|
2020-09-02 22:56:54 +02:00
|
|
|
azure-synapse-spark
|
2023-10-27 08:30:24 +02:00
|
|
|
bcrypt
|
|
|
|
certifi
|
|
|
|
cffi
|
2022-06-07 01:13:10 +02:00
|
|
|
chardet
|
2019-10-23 12:07:42 +02:00
|
|
|
colorama
|
|
|
|
cryptography
|
2021-09-12 03:43:54 +02:00
|
|
|
distro
|
2023-02-19 17:45:44 +01:00
|
|
|
fabric
|
2023-10-27 08:30:24 +02:00
|
|
|
humanfriendly
|
|
|
|
idna
|
|
|
|
invoke
|
|
|
|
isodate
|
|
|
|
javaproperties
|
|
|
|
jinja2
|
|
|
|
jmespath
|
|
|
|
jsondiff
|
2019-10-23 12:07:42 +02:00
|
|
|
knack
|
2023-10-27 08:30:24 +02:00
|
|
|
markupsafe
|
|
|
|
msal-extensions
|
|
|
|
msal
|
|
|
|
msrest
|
|
|
|
msrestazure
|
|
|
|
oauthlib
|
|
|
|
packaging
|
2019-10-23 12:07:42 +02:00
|
|
|
paramiko
|
2023-10-27 08:30:24 +02:00
|
|
|
pbr
|
|
|
|
pkginfo
|
|
|
|
portalocker
|
|
|
|
psutil
|
|
|
|
pycomposefile
|
|
|
|
pycparser
|
2023-02-19 18:42:00 +01:00
|
|
|
pygithub
|
2023-10-27 08:30:24 +02:00
|
|
|
pyjwt
|
2022-01-17 07:51:36 +01:00
|
|
|
pynacl
|
2019-10-23 12:07:42 +02:00
|
|
|
pyopenssl
|
2023-10-27 08:30:24 +02:00
|
|
|
python-dateutil
|
|
|
|
requests-oauthlib
|
2019-10-23 12:07:42 +02:00
|
|
|
requests
|
|
|
|
scp
|
2021-03-11 21:00:18 +01:00
|
|
|
semver
|
2019-10-23 12:07:42 +02:00
|
|
|
six
|
|
|
|
sshtunnel
|
2023-10-27 08:30:24 +02:00
|
|
|
tabulate
|
2019-10-23 12:07:42 +02:00
|
|
|
urllib3
|
2023-10-27 08:30:24 +02:00
|
|
|
wcwidth
|
2021-06-15 13:12:45 +02:00
|
|
|
websocket-client
|
2019-10-23 12:07:42 +02:00
|
|
|
xmltodict
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-04-27 19:43:07 +02:00
|
|
|
substituteInPlace az.completion.sh \
|
|
|
|
--replace register-python-argcomplete ${py.pkgs.argcomplete}/bin/register-python-argcomplete
|
2019-10-23 12:07:42 +02: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-10-26 20:18:09 +02:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
|
|
|
|
$out/bin/az --version
|
|
|
|
$out/bin/az self-test
|
2019-10-23 12:07:42 +02: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"
|
2019-12-01 23:28:29 +01:00
|
|
|
"azure.loganalytics"
|
2019-10-23 12:07:42 +02:00
|
|
|
"azure.mgmt.advisor"
|
|
|
|
"azure.mgmt.apimanagement"
|
|
|
|
"azure.mgmt.applicationinsights"
|
|
|
|
"azure.mgmt.appconfiguration"
|
2023-04-18 00:29:20 +02:00
|
|
|
"azure.mgmt.appcontainers"
|
2019-10-23 12:07:42 +02: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-09 21:44:29 +02: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 ];
|
2019-10-23 12:07:42 +02:00
|
|
|
license = licenses.mit;
|
2023-08-09 21:44:29 +02:00
|
|
|
mainProgram = "az";
|
2023-07-23 14:17:34 +02:00
|
|
|
maintainers = with maintainers; [ akechishiro jonringer ];
|
2023-08-09 21:44:29 +02:00
|
|
|
platforms = platforms.all;
|
2019-10-23 12:07:42 +02:00
|
|
|
};
|
|
|
|
})
|