diff --git a/pkgs/tools/package-management/nixops/azure-mgmt-compute/default.nix b/pkgs/tools/package-management/nixops/azure-mgmt-compute/default.nix new file mode 100644 index 0000000000000..462c9e615a139 --- /dev/null +++ b/pkgs/tools/package-management/nixops/azure-mgmt-compute/default.nix @@ -0,0 +1,37 @@ +{ pkgs +, buildPythonPackage +, fetchPypi +, python +, azure-mgmt-common +}: + +buildPythonPackage rec { + version = "0.20.1"; + pname = "azure-mgmt-compute"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "97298fc7f133f1d50a974ed6299151eda494a574b0f7fdf8192a388015c2215a"; + }; + + preConfigure = '' + # Patch to make this package work on requests >= 2.11.x + # CAN BE REMOVED ON NEXT PACKAGE UPDATE + sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/compute/computemanagement.py + ''; + + postInstall = '' + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py + ''; + + propagatedBuildInputs = [ azure-mgmt-common ]; + + meta = with pkgs.lib; { + description = "Microsoft Azure SDK for Python"; + homepage = "https://azure.microsoft.com/en-us/develop/python/"; + license = licenses.asl20; + maintainers = with maintainers; [ olcai ]; + }; +} diff --git a/pkgs/tools/package-management/nixops/azure-mgmt-network/default.nix b/pkgs/tools/package-management/nixops/azure-mgmt-network/default.nix new file mode 100644 index 0000000000000..fd47f8895fd4b --- /dev/null +++ b/pkgs/tools/package-management/nixops/azure-mgmt-network/default.nix @@ -0,0 +1,37 @@ +{ pkgs +, buildPythonPackage +, fetchPypi +, azure-mgmt-common +, python +}: + +buildPythonPackage rec { + version = "0.20.1"; + pname = "azure-mgmt-network"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "10vj22h6nxpw0qpvib5x2g6qs5j8z31142icvh4qk8k40fcrs9hx"; + }; + + preConfigure = '' + # Patch to make this package work on requests >= 2.11.x + # CAN BE REMOVED ON NEXT PACKAGE UPDATE + sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/network/networkresourceprovider.py + ''; + + postInstall = '' + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py + ''; + + propagatedBuildInputs = [ azure-mgmt-common ]; + + meta = with pkgs.lib; { + description = "Microsoft Azure SDK for Python"; + homepage = "https://azure.microsoft.com/en-us/develop/python/"; + license = licenses.asl20; + maintainers = with maintainers; [ olcai ]; + }; +} diff --git a/pkgs/tools/package-management/nixops/azure-mgmt-nspkg/default.nix b/pkgs/tools/package-management/nixops/azure-mgmt-nspkg/default.nix new file mode 100644 index 0000000000000..aa037b48b4f5d --- /dev/null +++ b/pkgs/tools/package-management/nixops/azure-mgmt-nspkg/default.nix @@ -0,0 +1,25 @@ +{ pkgs +, buildPythonPackage +, fetchPypi +, azure-nspkg +}: + +buildPythonPackage rec { + version = "1.0.0"; + pname = "azure-mgmt-nspkg"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "1rq92fj3kvnqkk18596dybw0kvhgscvc6cd8hp1dhy3wrkqnhwmq"; + }; + + propagatedBuildInputs = [ azure-nspkg ]; + + meta = with pkgs.lib; { + description = "Microsoft Azure SDK for Python"; + homepage = "https://azure.microsoft.com/en-us/develop/python/"; + license = licenses.asl20; + maintainers = with maintainers; [ olcai ]; + }; +} diff --git a/pkgs/tools/package-management/nixops/azure-mgmt-resource/default.nix b/pkgs/tools/package-management/nixops/azure-mgmt-resource/default.nix new file mode 100644 index 0000000000000..b60e3aee34028 --- /dev/null +++ b/pkgs/tools/package-management/nixops/azure-mgmt-resource/default.nix @@ -0,0 +1,38 @@ +{ pkgs +, buildPythonPackage +, fetchPypi +, python +, azure-mgmt-common +}: + + +buildPythonPackage rec { + version = "0.20.1"; + pname = "azure-mgmt-resource"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "0slh9qfm5nfacrdm3lid0sr8kwqzgxvrwf27laf9v38kylkfqvml"; + }; + + preConfigure = '' + # Patch to make this package work on requests >= 2.11.x + # CAN BE REMOVED ON NEXT PACKAGE UPDATE + sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/resource/resourcemanagement.py + ''; + + postInstall = '' + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py + ''; + + propagatedBuildInputs = [ azure-mgmt-common ]; + + meta = with pkgs.lib; { + description = "Microsoft Azure SDK for Python"; + homepage = "https://azure.microsoft.com/en-us/develop/python/"; + license = licenses.asl20; + maintainers = with maintainers; [ olcai ]; + }; +} diff --git a/pkgs/tools/package-management/nixops/azure-mgmt-storage/default.nix b/pkgs/tools/package-management/nixops/azure-mgmt-storage/default.nix new file mode 100644 index 0000000000000..2e0523bb25cc1 --- /dev/null +++ b/pkgs/tools/package-management/nixops/azure-mgmt-storage/default.nix @@ -0,0 +1,37 @@ +{ pkgs +, buildPythonPackage +, fetchPypi +, python +, azure-mgmt-common +}: + +buildPythonPackage rec { + version = "0.20.0"; + pname = "azure-mgmt-storage"; + + src = fetchPypi { + inherit pname version; + extension = "zip"; + sha256 = "16iw7hqhq97vlzfwixarfnirc60l5mz951p57brpcwyylphl3yim"; + }; + + preConfigure = '' + # Patch to make this package work on requests >= 2.11.x + # CAN BE REMOVED ON NEXT PACKAGE UPDATE + sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/storage/storagemanagement.py + ''; + + postInstall = '' + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py + echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py + ''; + + propagatedBuildInputs = [ azure-mgmt-common ]; + + meta = with pkgs.lib; { + description = "Microsoft Azure SDK for Python"; + homepage = "https://azure.microsoft.com/en-us/develop/python/"; + license = licenses.asl20; + maintainers = with maintainers; [ olcai ]; + }; +} diff --git a/pkgs/tools/package-management/nixops/default.nix b/pkgs/tools/package-management/nixops/default.nix index 56e0a31a97ecb..73e8c90d4e429 100644 --- a/pkgs/tools/package-management/nixops/default.nix +++ b/pkgs/tools/package-management/nixops/default.nix @@ -1,4 +1,4 @@ -{ callPackage, fetchurl }: +{ callPackage, newScope, pkgs, fetchurl }: callPackage ./generic.nix (rec { version = "1.6.1"; @@ -6,4 +6,19 @@ callPackage ./generic.nix (rec { url = "http://nixos.org/releases/nixops/nixops-${version}/nixops-${version}.tar.bz2"; sha256 = "0lfx5fhyg3z6725ydsk0ibg5qqzp5s0x9nbdww02k8s307axiah3"; }; +# nixops is incompatible with the most recent versions of listed +# azure-mgmt-* packages, therefore we are pinning them to +# package-private versions, so that they don't get trampled by +# updates. +# see +# https://github.com/NixOS/nixops/issues/1065 + python2Packages = pkgs.python2Packages.override { + overrides = (self: super: let callPackage = newScope self; in { + azure-mgmt-compute = callPackage ./azure-mgmt-compute { }; + azure-mgmt-network = callPackage ./azure-mgmt-network { }; + azure-mgmt-nspkg = callPackage ./azure-mgmt-nspkg { }; + azure-mgmt-resource = callPackage ./azure-mgmt-resource { }; + azure-mgmt-storage = callPackage ./azure-mgmt-storage { }; + }); + }; })