diff --git a/pkgs/tools/networking/octodns/default.nix b/pkgs/tools/networking/octodns/default.nix index e511070a4b79..618b2a0b57f1 100644 --- a/pkgs/tools/networking/octodns/default.nix +++ b/pkgs/tools/networking/octodns/default.nix @@ -1,26 +1,28 @@ { lib, - buildPythonPackage, - dnspython, fetchFromGitHub, - fqdn, - idna, - natsort, - pytestCheckHook, - python-dateutil, - python, - pythonOlder, - pyyaml, + python3, runCommand, - setuptools, -}: -buildPythonPackage rec { + # passthru + octodns, +}: +let + # Export `python` with `octodns` as a module for `octodns-providers`. + python = python3.override { + self = python; + packageOverrides = final: prev: { + octodns = final.toPythonModule octodns; + }; + }; + python3Packages = python.pkgs; +in +python3Packages.buildPythonApplication rec { pname = "octodns"; version = "1.10.0"; pyproject = true; - disabled = pythonOlder "3.8"; + disabled = python.pythonOlder "3.8"; src = fetchFromGitHub { owner = "octodns"; @@ -29,11 +31,11 @@ buildPythonPackage rec { hash = "sha256-L3c4lYt/fgMctJFArc1XlR+hvpz10kcBcYYXajnNQr0="; }; - build-system = [ + build-system = with python3Packages; [ setuptools ]; - dependencies = [ + dependencies = with python3Packages; [ dnspython fqdn idna @@ -42,21 +44,23 @@ buildPythonPackage rec { pyyaml ]; - nativeCheckInputs = [ + nativeCheckInputs = with python3Packages; [ pytestCheckHook ]; pythonImportsCheck = [ "octodns" ]; - passthru.withProviders = - ps: - let - pyEnv = python.withPackages ps; - in - runCommand "octodns-with-providers" { } '' - mkdir -p $out/bin - ln -st $out/bin ${pyEnv}/bin/octodns-* - ''; + passthru = { + withProviders = + ps: + let + pyEnv = python.withPackages ps; + in + runCommand "octodns-with-providers" { } '' + mkdir -p $out/bin + ln -st $out/bin ${pyEnv}/bin/octodns-* + ''; + }; meta = with lib; { description = "Tools for managing DNS across multiple providers"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index af829b484a35..38cd136163d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -419,7 +419,7 @@ with pkgs; deviceTree = callPackage ../os-specific/linux/device-tree { }; - octodns = python3Packages.callPackage ../tools/networking/octodns { }; + octodns = callPackage ../tools/networking/octodns { }; octodns-providers = recurseIntoAttrs { bind = python3Packages.callPackage ../tools/networking/octodns/providers/bind { };