feat(nix-lib): Add genAttrs' #316
1 changed files with 10 additions and 6 deletions
|
@ -4,18 +4,17 @@
|
|||
# SPDX-License-Identifier: EUPL-1.2
|
||||
{ lib }:
|
||||
|
||||
rec {
|
||||
let
|
||||
inherit (lib)
|
||||
flip
|
||||
optionals
|
||||
optionalString
|
||||
hasPrefix
|
||||
listToAttrs
|
||||
nameValuePair
|
||||
recursiveUpdate
|
||||
splitString
|
||||
unique
|
||||
warn
|
||||
;
|
||||
in
|
||||
|
||||
rec {
|
||||
/*
|
||||
Fuses a list of attribute sets into a single attribute set.
|
||||
|
||||
|
@ -97,6 +96,11 @@ rec {
|
|||
*/
|
||||
mapSingleFuse = f: mapFuse (x: singleAttr x (f x));
|
||||
|
||||
# Like genAttrs but allows configuring the name
|
||||
genAttrs' =
|
||||
names: f: g:
|
||||
listToAttrs (map (n: nameValuePair (f n) (g n)) names);
|
||||
|
||||
/*
|
||||
Creates a relative path as a string
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue