···118118119119- The legacy and long deprecated systemd target `network-interfaces.target` has been removed. Use `network.target` instead.
120120121121+- `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use
122122+123123+ ```nix
124124+ environment.systemPackages = [
125125+ (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]);
126126+ ];
127127+ ```
128128+ To make the `azure-cli` immutable and prevent clashes in case `azure-cli` is also installed via other package managers, some configuration files were moved into the derivation.
129129+ This can be disabled by overriding `withImmutableConfig = false` when building `azure-cli`.
130130+121131- `services.frp.settings` now generates the frp configuration file in TOML format as [recommended by upstream](https://github.com/fatedier/frp#configuration-files), instead of the legacy INI format. This has also introduced other changes in the configuration file structure and options.
122132 - The `settings.common` section in the configuration is no longer valid and all the options form inside it now goes directly under `settings`.
123133 - The `_` separating words in the configuration options is removed so the options are now in camel case. For example: `server_addr` becomes `serverAddr`, `server_port` becomes `serverPort` etc.
+57-2
pkgs/tools/admin/azure-cli/default.nix
···11{ lib
22, callPackage
33+, callPackages
44+, stdenvNoCC
55+, fetchurl
36, fetchFromGitHub
47, installShellFiles
88+, python3
59610 # Whether to include patches that enable placing certain behavior-defining
711 # configuration files in the Nix store.
812, withImmutableConfig ? true
1313+1414+ # List of extensions/plugins to include.
1515+, withExtensions ? [ ]
916}:
10171118let
···21282229 # put packages that needs to be overridden in the py package scope
2330 py = callPackage ./python-packages.nix { inherit src version; };
3131+3232+ # Builder for Azure CLI extensions. Extensions are Python wheels that
3333+ # outside of nix would be fetched by the CLI itself from various sources.
3434+ mkAzExtension =
3535+ { pname
3636+ , version
3737+ , url
3838+ , sha256
3939+ , description
4040+ }: python3.pkgs.buildPythonPackage {
4141+ inherit pname version;
4242+ format = "wheel";
4343+ src = fetchurl { inherit url sha256; };
4444+ meta = with lib; {
4545+ inherit description;
4646+ inherit (azure-cli.meta) platforms maintainers;
4747+ homepage = "https://github.com/Azure/azure-cli-extensions";
4848+ changelog = "https://github.com/Azure/azure-cli-extensions/blob/main/src/${pname}/HISTORY.rst";
4949+ license = lib.licenses.mit;
5050+ sourceProvenance = [ sourceTypes.fromSource ];
5151+ };
5252+ };
5353+5454+ extensions = callPackages ./extensions-generated.nix { inherit mkAzExtension; };
5555+5656+ extensionDir = stdenvNoCC.mkDerivation {
5757+ name = "azure-cli-extensions";
5858+ dontUnpack = true;
5959+ installPhase =
6060+ let
6161+ namePaths = map (p: "${p.pname},${p}/${python3.sitePackages}") withExtensions;
6262+ in
6363+ ''
6464+ for line in ${lib.concatStringsSep " " namePaths}; do
6565+ name=$(echo $line | cut -d',' -f1)
6666+ path=$(echo $line | cut -d',' -f2)
6767+ mkdir -p $out/$name
6868+ for f in $(ls $path); do
6969+ ln -s $path/$f $out/$name/$f
7070+ done
7171+ done
7272+ '';
7373+ };
2474in
25752676py.pkgs.toPythonApplication (py.pkgs.buildAzureCliPackage {
···199249 wrapProgram $out/bin/az \
200250 '' + lib.optionalString withImmutableConfig ''
201251 --set AZURE_IMMUTABLE_DIR $out/etc/azure \
252252+ '' + lib.optionalString (withExtensions != [ ]) ''
253253+ --set AZURE_EXTENSION_DIR ${extensionDir} \
202254 '' + ''
203255 --set PYTHONPATH $PYTHONPATH
204204- ''
205205- ;
256256+ '';
206257207258 doInstallCheck = true;
208259 installCheckPhase = ''
···283334 "azure.storage.blob"
284335 "azure.storage.common"
285336 ];
337337+338338+ passthru = {
339339+ inherit extensions;
340340+ };
286341287342 meta = with lib; {
288343 homepage = "https://github.com/Azure/azure-cli";