lib: create 'my' extensions

Inspired by this [1] repo, I want to add some functions to `lib.my`. I
would have liked to make it work without having to use an overlay, but I
did not manage to do it...

[1]: https://github.com/hlissner/dotfiles
This commit is contained in:
Bruno BELANYI 2021-03-10 18:49:12 +00:00
parent 11b25a0e0e
commit 331b7cf8e3
4 changed files with 63 additions and 3 deletions

7
lib/attrs.nix Normal file
View file

@ -0,0 +1,7 @@
{ lib, ... }:
let
inherit (lib) filterAttrs mapAttrs';
in
{
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
}