summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-05-07 15:27:05 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-05-10 15:55:08 +0200
commit16d594a0e2017bfa8b24051f4697d8debc240bfb (patch)
treee97dac498b4fce5165ca2b48a99a6b174bb173ee /lib
parent897876e4c484f1e8f92009fd11b7d988a121a4e7 (diff)
lib.types.pkgs: init
A nominal type.
Diffstat (limited to 'lib')
-rw-r--r--lib/types.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index e0da18a2febb9..373d0ce7876f9 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -476,6 +476,14 @@ rec {
       check = x: isDerivation x && hasAttr "shellPath" x;
     };
 
+    pkgs = addCheck
+      (unique { message = "A Nixpkgs pkgs set can not be merged with another pkgs set."; } attrs // {
+        name = "pkgs";
+        descriptionClass = "noun";
+        description = "Nixpkgs package set";
+      })
+      (x: (x._type or null) == "pkgs");
+
     path = mkOptionType {
       name = "path";
       descriptionClass = "noun";