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 {