~aasg/nixexprs

ref: 7cdebdedacf1dcaed6d3d3f749f90693b4debb03 nixexprs/ci.nix -rw-r--r-- 824 bytes
7cdebded — Aluísio Augusto Silva Gonçalves dyndnsc: Remove import fallback for default package 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ pkgs ? import <nixpkgs> { } }:
let
  inherit (pkgs) recurseIntoAttrs;
  inherit (pkgs.lib) deepSeq filterAttrs isDerivation mapAttrs pipe;

  selectDerivations = set:
    let
      derivationTree = value:
        if isDerivation value
        then value
        else if value ? recurseForDerivations && value.recurseForDerivations == true
        then
          pipe value [
            (mapAttrs (name: derivationTree))
            (filterAttrs (name: value: value != null))
            recurseIntoAttrs
          ]
        else null;
    in
    derivationTree (recurseIntoAttrs set);

  self = import ./. { inherit pkgs; };
in
{
  lib = deepSeq (import ./lib/tests.nix { lib = pkgs.lib; }) { };

  newPackages = selectDerivations self.packageSets.pkgs;

  patchedPackages = selectDerivations self.packageSets.patches;
}