Skip to content

Instantly share code, notes, and snippets.

@haslersn
Created March 23, 2019 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haslersn/ce38fb5014be94c86737f61a99aa6283 to your computer and use it in GitHub Desktop.
Save haslersn/ce38fb5014be94c86737f61a99aa6283 to your computer and use it in GitHub Desktop.
{ lib, ... }:
{
flipNames = attrs:
lib.mapAttrs
(_: lib.foldl (a: b: a // b) {})
(lib.zipAttrs
(lib.mapAttrsToList
(n: v: lib.mapAttrs (n': v': { ${n} = v'; }) v)
attrs
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment