2 # Generic nixpkgs, use *only* for lib functions that are stable across versions
3 pkgs = import (import ./nix/sources.nix).nixpkgs {};
6 inherit (import ./dimension.nix) dimension;
8 # A filter for removing packages that aren't supported on the current platform
9 # according to 'meta.platforms'.
10 platformFilterGeneric = pkgs: system:
11 # This needs to use the correct nixpkgs version so all the systems line up
13 platform = lib.systems.elaborate { inherit system; };
14 # Can't just default to [] for platforms, since no meta.platforms
15 # means "all platforms" not "no platforms"
16 in drv : if drv ? meta && drv.meta ? platforms then
17 lib.any (lib.meta.platformMatch platform) drv.meta.platforms
20 # Hydra doesn't like these attributes hanging around in "jobsets": it thinks they're jobs!
21 stripAttrsForHydra = filterAttrsOnlyRecursive (n: _: n != "recurseForDerivations" && n != "dimension");
23 # Keep derivations and attrsets with 'recurseForDerivations'. This ensures that we match the
24 # derivations that Hercules will see, and prevents Hydra from trying to pick up all sorts of bad stuff
25 # (like attrsets that contain themselves!).
26 filterDerivations = filterAttrsOnlyRecursive (n: attrs: lib.isDerivation attrs || attrs.recurseForDerivations or false);
28 # A version of 'filterAttrsRecursive' that doesn't recurse into derivations. This prevents us from going into an infinite
29 # loop with the 'out' attribute on derivations.
30 # TODO: Surely this shouldn't be necessary. I think normal 'filterAttrsRecursive' will effectively cause infinite loops
31 # if you keep derivations and your predicate forces the value of the attribute, as this then triggers a loop on the
32 # 'out' attribute. Weird.
33 # To make this function faster, unwanted attributes are mapped to {} instead of being
34 # removed. This keeps the function lazy and avoids unwanted evaluation of sibling
36 filterAttrsOnlyRecursive = pred: set:
37 lib.mapAttrs (name: v:
41 && !lib.isDerivation v
42 then filterAttrsOnlyRecursive pred v
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list