From da9162f667e5833b885edae3631299c0e7005d2b Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 20 Feb 2022 19:23:12 +0000 Subject: add mechanism for handling meta.sourceProvenance attributes heavily based on patterns used by licenses infrastructure, so may appear overengineered for its initial level of use --- lib/source-types.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/source-types.nix (limited to 'lib/source-types.nix') diff --git a/lib/source-types.nix b/lib/source-types.nix new file mode 100644 index 0000000000000..8a4ab540b9da1 --- /dev/null +++ b/lib/source-types.nix @@ -0,0 +1,25 @@ +{ lib }: + +lib.mapAttrs (tname: tset: let + defaultSourceType = { + shortName = tname; + isSource = false; + }; + + mkSourceType = sourceTypeDeclaration: let + applyDefaults = sourceType: defaultSourceType // sourceType; + in lib.pipe sourceTypeDeclaration [ + applyDefaults + ]; +in mkSourceType tset) { + + fromSource = { + isSource = true; + }; + + binaryNativeCode = {}; + + binaryBytecode = {}; + + binaryFirmware = {}; +} -- cgit 1.4.1