From 9c00c9af715093c34830a873ba499b0fb42551d5 Mon Sep 17 00:00:00 2001 From: Niols Date: Thu, 10 Jul 2025 14:36:16 +0200 Subject: [PATCH] lib.types: add a `fileset` type --- lib/types.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/types.nix b/lib/types.nix index 6b51f9254a00..1085c36cab01 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -66,6 +66,11 @@ let fixupOptionType mergeOptionDecls ; + inherit (lib.fileset) + isFileset + unions + empty + ; inAttrPosSuffix = v: name: @@ -612,6 +617,15 @@ let }; }; + fileset = mkOptionType { + name = "fileset"; + description = "fileset"; + descriptionClass = "noun"; + check = isFileset; + merge = loc: defs: unions (map (x: x.value) defs); + emptyValue.value = empty; + }; + # A package is a top-level store path (/nix/store/hash-name). This includes: # - derivations # - more generally, attribute sets with an `outPath` or `__toString` attribute