Skip to content

Commit

Permalink
Try filling in outputs on all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Oct 17, 2024
1 parent 141909d commit e7ea760
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions nix/choose-meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

contents:

let
hasNontrivialOutputs = (contents.outputs or ["out"]) != ["out"];

in

(lib.optionalAttrs (contents ? "version") {
version = contents.version;
}) // (lib.optionalAttrs (contents ? "meta") (
Expand Down Expand Up @@ -33,8 +38,21 @@ contents:
has_packages = contents.meta.hasPackages;
}) // (lib.optionalAttrs (lib.hasAttrByPath ["meta" "lessCommon"] contents) {
less_common = contents.meta.lessCommon;
}) // (lib.optionalAttrs (contents ? "settingsSchema") {
settings_schema = contents.settingsSchema;
}) // (lib.optionalAttrs ((contents ? "settingsSchema") || hasNontrivialOutputs) {
settings_schema =
(contents.settingsSchema or {})
// lib.optionalAttrs hasNontrivialOutputs {
outputs = {
title = "Outputs";
description = "Package outputs to include.";
type = "list";
listType = {
type = "enum";
values = (contents.outputs or ["out"]);
};
defaultValue = ["out"];
};
};
}) // (lib.optionalAttrs (contents ? "modes") {
inherit (contents) modes;
}) // (lib.optionalAttrs (contents ? "languageServerNames") {
Expand Down

0 comments on commit e7ea760

Please sign in to comment.