From e2702f5aee1b6719d93e89de8acd69430de4bf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 12 Sep 2023 17:07:58 +0200 Subject: [PATCH] treewide: don't use python3Minimal where it is not required Building a python environment with python3Minimal requires hydra to bootstrap pip and build all packages used in the environment which would otherwise not be built. This reduces cache re-use and duplicates things. Also common dependencies normally included in python itself are not properly checked and can cause hard to debug errors because everyone just assumes those modules are there. --- nixos/lib/make-options-doc/default.nix | 2 +- nixos/tests/installer.nix | 8 +------- nixos/tests/os-prober.nix | 2 +- pkgs/tools/nix/nixos-render-docs/default.nix | 9 +-------- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index 99515b5b8276..284934a7608e 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -120,7 +120,7 @@ in rec { { meta.description = "List of NixOS options in JSON format"; nativeBuildInputs = [ pkgs.brotli - pkgs.python3Minimal + pkgs.python3 ]; options = builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsNix)); diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index f7fc168eba8c..c7711d151ddd 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -510,14 +510,8 @@ let ntp perlPackages.ListCompare perlPackages.XMLLibXML - python3Minimal # make-options-doc/default.nix - (let - self = (pkgs.python3Minimal.override { - inherit self; - includeSiteCustomize = true; - }); - in self.withPackages (p: [ p.mistune ])) + python3.withPackages (p: [ p.mistune ]) shared-mime-info sudo texinfo diff --git a/nixos/tests/os-prober.nix b/nixos/tests/os-prober.nix index dae1306bd69d..034de0620d88 100644 --- a/nixos/tests/os-prober.nix +++ b/nixos/tests/os-prober.nix @@ -95,7 +95,7 @@ in { ntp perlPackages.ListCompare perlPackages.XMLLibXML - python3Minimal + python3 shared-mime-info stdenv sudo diff --git a/pkgs/tools/nix/nixos-render-docs/default.nix b/pkgs/tools/nix/nixos-render-docs/default.nix index d2b8f1a0614b..b08abfe069f7 100644 --- a/pkgs/tools/nix/nixos-render-docs/default.nix +++ b/pkgs/tools/nix/nixos-render-docs/default.nix @@ -1,18 +1,11 @@ { lib , stdenv , python3 -, python3Minimal , runCommand }: let - # python3Minimal can't be overridden with packages on Darwin, due to a missing framework. - # Instead of modifying stdenv, we take the easy way out, since most people on Darwin will - # just be hacking on the Nixpkgs manual (which also uses make-options-doc). - python = ((if stdenv.isDarwin then python3 else python3Minimal).override { - self = python; - includeSiteCustomize = true; - }).override { + python = python3.override { packageOverrides = final: prev: { markdown-it-py = prev.markdown-it-py.overridePythonAttrs (_: { doCheck = false;