From 16d594a0e2017bfa8b24051f4697d8debc240bfb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 7 May 2023 15:27:05 +0200 Subject: [PATCH] lib.types.pkgs: init A nominal type. --- lib/types.nix | 8 ++++++++ nixos/doc/manual/development/option-types.section.md | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/lib/types.nix b/lib/types.nix index e0da18a2febb..373d0ce7876f 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"; diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index 9e2ecb8e3562..9e156ebff9d3 100644 --- a/nixos/doc/manual/development/option-types.section.md +++ b/nixos/doc/manual/development/option-types.section.md @@ -99,6 +99,10 @@ merging is handled. problems. ::: +`types.pkgs` + +: A type for the top level Nixpkgs package set. + ### Numeric types {#sec-option-types-numeric} `types.int`