···118119- The legacy and long deprecated systemd target `network-interfaces.target` has been removed. Use `network.target` instead.
1200000000000121- `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.
122 - The `settings.common` section in the configuration is no longer valid and all the options form inside it now goes directly under `settings`.
123 - 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.
···118119- The legacy and long deprecated systemd target `network-interfaces.target` has been removed. Use `network.target` instead.
120121+- `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use
122+123+ ```nix
124+ environment.systemPackages = [
125+ (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]);
126+ ];
127+ ```
128+ 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.
129+ This can be disabled by overriding `withImmutableConfig = false` when building `azure-cli`.
130+131- `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.
132 - The `settings.common` section in the configuration is no longer valid and all the options form inside it now goes directly under `settings`.
133 - 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
···1{ lib
2, callPackage
0003, fetchFromGitHub
4, installShellFiles
056 # Whether to include patches that enable placing certain behavior-defining
7 # configuration files in the Nix store.
8, withImmutableConfig ? true
0009}:
1011let
···2122 # put packages that needs to be overridden in the py package scope
23 py = callPackage ./python-packages.nix { inherit src version; };
000000000000000000000000000000000000000000024in
2526py.pkgs.toPythonApplication (py.pkgs.buildAzureCliPackage {
···199 wrapProgram $out/bin/az \
200 '' + lib.optionalString withImmutableConfig ''
201 --set AZURE_IMMUTABLE_DIR $out/etc/azure \
00202 '' + ''
203 --set PYTHONPATH $PYTHONPATH
204- ''
205- ;
206207 doInstallCheck = true;
208 installCheckPhase = ''
···283 "azure.storage.blob"
284 "azure.storage.common"
285 ];
0000286287 meta = with lib; {
288 homepage = "https://github.com/Azure/azure-cli";
···1{ lib
2, callPackage
3+, callPackages
4+, stdenvNoCC
5+, fetchurl
6, fetchFromGitHub
7, installShellFiles
8+, python3
910 # Whether to include patches that enable placing certain behavior-defining
11 # configuration files in the Nix store.
12, withImmutableConfig ? true
13+14+ # List of extensions/plugins to include.
15+, withExtensions ? [ ]
16}:
1718let
···2829 # put packages that needs to be overridden in the py package scope
30 py = callPackage ./python-packages.nix { inherit src version; };
31+32+ # Builder for Azure CLI extensions. Extensions are Python wheels that
33+ # outside of nix would be fetched by the CLI itself from various sources.
34+ mkAzExtension =
35+ { pname
36+ , version
37+ , url
38+ , sha256
39+ , description
40+ }: python3.pkgs.buildPythonPackage {
41+ inherit pname version;
42+ format = "wheel";
43+ src = fetchurl { inherit url sha256; };
44+ meta = with lib; {
45+ inherit description;
46+ inherit (azure-cli.meta) platforms maintainers;
47+ homepage = "https://github.com/Azure/azure-cli-extensions";
48+ changelog = "https://github.com/Azure/azure-cli-extensions/blob/main/src/${pname}/HISTORY.rst";
49+ license = lib.licenses.mit;
50+ sourceProvenance = [ sourceTypes.fromSource ];
51+ };
52+ };
53+54+ extensions = callPackages ./extensions-generated.nix { inherit mkAzExtension; };
55+56+ extensionDir = stdenvNoCC.mkDerivation {
57+ name = "azure-cli-extensions";
58+ dontUnpack = true;
59+ installPhase =
60+ let
61+ namePaths = map (p: "${p.pname},${p}/${python3.sitePackages}") withExtensions;
62+ in
63+ ''
64+ for line in ${lib.concatStringsSep " " namePaths}; do
65+ name=$(echo $line | cut -d',' -f1)
66+ path=$(echo $line | cut -d',' -f2)
67+ mkdir -p $out/$name
68+ for f in $(ls $path); do
69+ ln -s $path/$f $out/$name/$f
70+ done
71+ done
72+ '';
73+ };
74in
7576py.pkgs.toPythonApplication (py.pkgs.buildAzureCliPackage {
···249 wrapProgram $out/bin/az \
250 '' + lib.optionalString withImmutableConfig ''
251 --set AZURE_IMMUTABLE_DIR $out/etc/azure \
252+ '' + lib.optionalString (withExtensions != [ ]) ''
253+ --set AZURE_EXTENSION_DIR ${extensionDir} \
254 '' + ''
255 --set PYTHONPATH $PYTHONPATH
256+ '';
0257258 doInstallCheck = true;
259 installCheckPhase = ''
···334 "azure.storage.blob"
335 "azure.storage.common"
336 ];
337+338+ passthru = {
339+ inherit extensions;
340+ };
341342 meta = with lib; {
343 homepage = "https://github.com/Azure/azure-cli";