diff options
author | Robert Scott <code@humanleg.org.uk> | 2022-02-20 19:23:12 +0000 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2022-05-30 16:27:34 +0800 |
commit | da9162f667e5833b885edae3631299c0e7005d2b (patch) | |
tree | 6a435bfbd822ad8c133a5b797da1d05fe1d58a15 /lib/source-types.nix | |
parent | 93e6a4b6070a305c7608de120004b3a25f76f796 (diff) | |
download | nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar.gz nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar.bz2 nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar.lz nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar.xz nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar.zst nixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.zip |
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
Diffstat (limited to 'lib/source-types.nix')
-rw-r--r-- | lib/source-types.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/source-types.nix b/lib/source-types.nix new file mode 100644 index 00000000000..8a4ab540b9d --- /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 = {}; +} |