summaryrefslogtreecommitdiff
path: root/lib/source-types.nix
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2022-02-20 19:23:12 +0000
committerAlexander Foremny <aforemny@posteo.de>2022-05-30 16:27:34 +0800
commitda9162f667e5833b885edae3631299c0e7005d2b (patch)
tree6a435bfbd822ad8c133a5b797da1d05fe1d58a15 /lib/source-types.nix
parentMerge pull request #175163 from athas/geomyidae (diff)
downloadnixpkgs-da9162f667e5833b885edae3631299c0e7005d2b.tar.gz
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.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/source-types.nix b/lib/source-types.nix
new file mode 100644
index 000000000000..8a4ab540b9da
--- /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 = {};
+}