diff options
author | pennae <github@quasiparticle.net> | 2022-08-05 17:13:47 +0200 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2022-08-05 17:13:47 +0200 |
commit | af98bacbe014021172b75e608187fa84937a99ce (patch) | |
tree | 871d7715ebf77079e461ac2db70326af1636d7dd /nixos/lib | |
parent | 61e93df1891972bae3e0c97a477bd44e8a477aa0 (diff) |
Revert "nixos/docs: cache mergeJSON md conversion on baseOptionsJSON"
This reverts commit 52b0ad17e3727fe0c3ca028787128ede5fb86352. we only needed this because mergeJSON was slow, but in the interim we found a better solution to the slowness.
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/make-options-doc/default.nix | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index e039bc4a9b73d..6649fc41d41aa 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -99,14 +99,6 @@ let optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList); - pythonMD = - let - self = (pkgs.python3Minimal.override { - inherit self; - includeSiteCustomize = true; - }); - in self.withPackages (p: [ p.mistune_2_0 ]); - in rec { inherit optionsNix; @@ -124,20 +116,17 @@ in rec { optionsJSON = pkgs.runCommand "options.json" { meta.description = "List of NixOS options in JSON format"; - buildInputs = [ pkgs.brotli pythonMD ]; + buildInputs = [ + pkgs.brotli + (let + self = (pkgs.python3Minimal.override { + inherit self; + includeSiteCustomize = true; + }); + in self.withPackages (p: [ p.mistune_2_0 ])) + ]; options = builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsNix)); - # convert markdown to docbook in its own derivation to cache the - # conversion results. the conversion is surprisingly expensive. - baseJSON = - if baseOptionsJSON != null - then - pkgs.runCommand "base-json-md-converted" { - buildInputs = [ pythonMD ]; - } '' - python ${./mergeJSON.py} ${baseOptionsJSON} <(echo '{}') > $out - '' - else null; } '' # Export list of options in different format. @@ -154,7 +143,7 @@ in rec { else '' python ${./mergeJSON.py} \ ${lib.optionalString warningsAreErrors "--warnings-are-errors"} \ - $baseJSON $options \ + ${baseOptionsJSON} $options \ > $dst/options.json '' } |