all repos — nix-packages @ ddf8f097f03b71bf55fbe84b5cc09f69768b46ec

My personal collection of packages for nix

attrs.nix (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  pkgs ? import <nixpkgs> { },
}:
let
  inherit (pkgs) lib;
  nurAttrs = import ./pkgs { inherit pkgs; };

  mapRecursive =
    path: value:
    if lib.isDerivation value then
      [
        (builtins.concatStringsSep "." path)
      ]
    else if builtins.isAttrs value then
      lib.concatMap (name: mapRecursive (path ++ [ name ]) value.${name}) (builtins.attrNames value)
    else
      [ ];
in
(mapRecursive [ ] nurAttrs)