diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-02-02 14:13:53 +0000 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2023-02-02 16:49:27 +0100 |
commit | d608fbb9f61f91d018e2a778df21373f0f340186 (patch) | |
tree | 1852d77978011ef698f209f39e637a9df4c467a8 /pkgs/development/interpreters/python/mk-python-derivation.nix | |
parent | 6d5025d6315319f7d3d5e1edd6f099c75ccbd1c2 (diff) | |
download | nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.tar nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.tar.gz nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.tar.bz2 nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.tar.lz nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.tar.xz nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.tar.zst nixpkgs-d608fbb9f61f91d018e2a778df21373f0f340186.zip |
buildPython*: allow overriding disabled packages
Previously: nix-repl> python3.pkgs.WSME error: WSME-0.11.0 not supported for interpreter python3.10 nix-repl> python3.pkgs.WSME.overridePythonAttrs (_: { disabled = false; }) error: WSME-0.11.0 not supported for interpreter python3.10 Now: nix-repl> python3.pkgs.WSME error: WSME-0.11.0 not supported for interpreter python3.10 «derivation nix-repl> python3.pkgs.WSME.overridePythonAttrs (_: { disabled = false; }) «derivation /nix/store/cxkiwdfm146zvl573s2hahlbjd1wfrrp-python3.10-WSME-0.11.0.drv»
Diffstat (limited to 'pkgs/development/interpreters/python/mk-python-derivation.nix')
-rw-r--r-- | pkgs/development/interpreters/python/mk-python-derivation.nix | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 971eacb71d9..b1f35cc2fb1 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -101,12 +101,6 @@ , ... } @ attrs: - -# Keep extra attributes from `attrs`, e.g., `patchPhase', etc. -if disabled -then throw "${name} not supported for interpreter ${python.executable}" -else - let inherit (python) stdenv; @@ -114,6 +108,7 @@ let name_ = name; + # Keep extra attributes from `attrs`, e.g., `patchPhase', etc. self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [ "disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format" "disabledTestPaths" "outputs" @@ -204,4 +199,7 @@ let passthru.updateScript = let filename = builtins.head (lib.splitString ":" self.meta.position); in attrs.passthru.updateScript or [ update-python-libraries filename ]; -in lib.extendDerivation true passthru self +in lib.extendDerivation + (disabled -> throw "${name} not supported for interpreter ${python.executable}") + passthru + self |