Unverified Commit 9c00c9af authored by Niols's avatar Niols
Browse files

lib.types: add a `fileset` type

parent b99df9d4
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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