From 8ffc63ae42d435ca429f802de027d27472e2ec37 Mon Sep 17 00:00:00 2001 From: Austreelis Date: Fri, 3 Oct 2025 05:15:39 +0000 Subject: [PATCH] fix: package license causing hydra eval fails (#30) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Difference in license attrset schema between lib and tidepool caused eval fails, as in [here](https://hydra.aux-cache.dev/jobset/aux/tidepool#tabs-errors). This PR changes tidepool's scheme to align it with lib: ```console ❯ nix eval -f tidepool packages.foundation.bash.latest.meta.license --json | jq { "free": true, "fullName": "GNU General Public License v3.0 or later", "name": "gpl3Plus", "redistributable": true, "spdxId": "GPL-3.0-or-later", "url": "https://spdx.org/licenses/GPL-3.0-or-later.html" } ``` I kinda liked the previous schema of tidepool, but it's a lower impact fix than bumping lib's major, and I think we want to think more about licenses in lib (e.g. it would probably make sense to move tidepool's license type there to avoid dupplicating the code for the default behavior). Co-authored-by: austreelis Reviewed-on: https://git.auxolotl.org/auxolotl/labs/pulls/30 Reviewed-by: vlinkz Co-authored-by: Austreelis Co-committed-by: Austreelis --- tidepool/src/lib/types.nix | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tidepool/src/lib/types.nix b/tidepool/src/lib/types.nix index f74f8b5..a34b42d 100644 --- a/tidepool/src/lib/types.nix +++ b/tidepool/src/lib/types.nix @@ -13,19 +13,18 @@ in { config }: { options = { - name = { - full = lib.options.create { - description = "The full name of the license."; - type = lib.types.string; - }; - short = lib.options.create { - description = "The short name of the license."; - type = lib.types.string; - }; + name = lib.options.create { + description = "The short name of the license."; + type = lib.types.string; }; - spdx = lib.options.create { + fullName = lib.options.create { + description = "The full name of the license."; + type = lib.types.string; + }; + + spdxId = lib.options.create { description = "The SPDX identifier for the license."; type = lib.types.nullish lib.types.string; default.value = null; @@ -33,7 +32,11 @@ in url = lib.options.create { description = "The URL for the license."; - type = lib.types.nullish lib.types.string; + type = lib.types.string; + default = { + text = "spdx.org entry, if `spdxId` is set, `null` otherwise"; + value = if config.spdxId == null then null else "https://spdx.org/licenses/${config.spdxId}.html"; + }; }; free = lib.options.create {