Skip to content

Commit

Permalink
nixops: Re-package environment using poetry2nix
Browse files Browse the repository at this point in the history
The NixOps derivation keeps breaking because of unrelated Python packaging work and is incredibly difficult to keep alive.
Rather than outright removing 1.7 as suggested in NixOS#150059 this change shuold make it much easier to keep 1.7 on life support without causing any burden for those wanting to work on python3 only.
  • Loading branch information
adisbladis authored and jsoo1 committed Oct 10, 2022
1 parent eabc382 commit 5fd9eff
Show file tree
Hide file tree
Showing 4 changed files with 690 additions and 8 deletions.
22 changes: 14 additions & 8 deletions pkgs/tools/package-management/nixops/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{ lib, python2Packages, libxslt, docbook_xsl_ns, openssh, cacert, nixopsAzurePackages ? []
{ lib, python2, poetry2nix, docbook_xsl_ns, openssh, cacert, nixopsAzurePackages ? []
, fetchurl, fetchpatch
}:

python2Packages.buildPythonApplication rec {
let
inherit (poetry2nix.mkPoetryPackages {
projectDir = ./python-env;
python = python2;
}) python;
pythonPackages = python.pkgs;

in pythonPackages.buildPythonApplication rec {
pname = "nixops";
version = "1.7";

Expand All @@ -19,23 +26,22 @@ python2Packages.buildPythonApplication rec {
./optional-virtd.patch
];

buildInputs = [ libxslt ];
buildInputs = [ pythonPackages.libxslt ];

pythonPath = with python2Packages;
pythonPath = (with pythonPackages;
[ prettytable
boto
boto3
hetzner
libcloud
apache-libcloud
adal
# Go back to sqlite once Python 2.7.13 is released
pysqlite
datadog
digital-ocean
typing
python-digitalocean
]
++ lib.optional (!libvirt.passthru.libvirt.meta.insecure or true) libvirt
++ nixopsAzurePackages;
++ nixopsAzurePackages);

checkPhase =
# Ensure, that there are no (python) import errors
Expand Down
Loading

0 comments on commit 5fd9eff

Please sign in to comment.