Using regular Nix, we can setup Azure CLI Extensions properly.
pkgs.azure-cli.override {
withExtensions = with pkgs.azure-cli-extensions; [
account
aks-preview
bastion
ssh
];
};
How can we setup those extensions with Flox?
Using regular Nix, we can setup Azure CLI Extensions properly.
pkgs.azure-cli.override {
withExtensions = with pkgs.azure-cli-extensions; [
account
aks-preview
bastion
ssh
];
};
How can we setup those extensions with Flox?
Hey
!
As of a few weeks (Flox version 1.6.0 and above) you are able to do this. We are yet to really announce it on our Blog and show how to use it, but there is already a section in our documentation.
We call this feature “Nix expression builds”:
If you copy your azure-cli override into .flox/pkgs/azure-cli.nix you should be able to build it with flox build azure-cli.
But that is only half of the story, and here is also where Flox is different from Nix.
With Nix, you would just include this package in your devShell and you’ll have an environment with custom version of azure-cli.
With Flox, environments that you create carry a guarantee that packages included in the environment were build at some point in the past and a binary cache for them exists. You can see how this guarantee is useful, especially in a team setup, which is the main focus for Flox. But it comes with a drawback, namely you can just include your builds immediately, you need to first publish them. Now if publishing a package would be complicated that would indeed be a downside, but as you can suspect publishing a package easy.
How do you publish a package?
Step 1: Login to FloxHub, flox auth login.
Step 2: Publish a package to your own private catalog, flox publish azure-cli (you will have to commit and push this changes to a remote repository)
I would suggest you create a separate environment called sheeng-pkgs from where you can author new/custom packages and published them to FloxHub.
How to use a custom package?
Step 3: flox search azure-cli will also return your custom package, but with a prefix, eg. sheeng/azure-cli
Step 4: Simply install the package as you would any other flox install sheeng/azure-cli
This is not the only way to build new/custom packages, there is also “Manifest builds” which some might prefer, but that is probably for another time.
Let me know if this solved the problem for you.