Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overlay: remove azure-cli with confcom extension #965

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
overlays = [ (import ./overlays/nixpkgs.nix) ];
config.allowUnfree = true;
config.nvidia.acceptLicense = true;
# TODO(miampf): REMOVE AGAIN ONCE UNNEEDED
config.permittedInsecurePackages = [
"openssl-1.1.1w"
];
};
inherit (pkgs) lib;
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
Expand Down
57 changes: 1 addition & 56 deletions overlays/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,7 @@
# SPDX-License-Identifier: AGPL-3.0-only

final: prev:
# TODO(miampf): Remove unneccessary block once https://github.com/NixOS/nixpkgs/pull/345326 is merged into unstable nixpkgs
let
# Builder for Azure CLI extensions. Extensions are Python wheels that
# outside of nix would be fetched by the CLI itself from various sources.
mkAzExtension =
{
pname,
url,
sha256,
description,
...
}@args:
prev.python3.pkgs.buildPythonPackage (
{
format = "wheel";
src = prev.fetchurl { inherit url sha256; };
meta = {
inherit description;
inherit (prev.azure-cli.meta) platforms maintainers;
homepage = "https://github.com/Azure/azure-cli-extensions";
changelog = "https://github.com/Azure/azure-cli-extensions/blob/main/src/${pname}/HISTORY.rst";
license = prev.lib.licenses.mit;
sourceProvenance = [ prev.lib.sourceTypes.fromSource ];
} // args.meta or { };
}
// (removeAttrs args [
"url"
"sha256"
"description"
"meta"
])
);

confcom = mkAzExtension rec {
pname = "confcom";
version = "1.0.0";
url = "https://azcliprod.blob.core.windows.net/cli-extensions/confcom-${version}-py3-none-any.whl";
sha256 = "73823e10958a114b4aca84c330b4debcc650c4635e74c568679b6c32c356411d";
description = "Microsoft Azure Command-Line Tools Confidential Container Security Policy Generator Extension";
nativeBuildInputs = [ prev.autoPatchelfHook ];
buildInputs = [ prev.openssl_1_1 ];
propagatedBuildInputs = with prev.python3Packages; [
pyyaml
deepdiff
docker
tqdm
];
postInstall = ''
chmod +x $out/${prev.python3.sitePackages}/azext_confcom/bin/genpolicy-linux
'';
meta.maintainers = with prev.lib.maintainers; [ miampf ];
};
in
{
# Use when a version of Go is needed that is not available in the nixpkgs yet.
# go_1_xx = prev.go_1_xx.overrideAttrs (finalAttrs: _prevAttrs: {
Expand All @@ -67,10 +15,7 @@ in

# Add the required extensions to the Azure CLI.
azure-cli = prev.azure-cli.override {
withExtensions = with final.azure-cli.extensions; [
aks-preview
confcom
];
withExtensions = with final.azure-cli.extensions; [ aks-preview ];
};

# Use a newer uplosi that has fixes for private galleries.
Expand Down