13 lines
445 B
Nix
13 lines
445 B
Nix
{lib}: {
|
|
/**
|
|
Get a list of patches from a path.
|
|
*/
|
|
patchesInPath = path: let
|
|
pathContents = builtins.readDir path;
|
|
filter = name: value:
|
|
(value == "regular" || value == "symlink") && lib.strings.hasSuffix ".patch" name;
|
|
filteredContents = lib.attrsets.filterAttrs filter pathContents;
|
|
patchFilenames = builtins.attrNames filteredContents;
|
|
in
|
|
builtins.map (value: lib.path.append path value) patchFilenames;
|
|
}
|