Something went wrong. Try again.
[Mirror] NUR repo for my Nix packages, and some modules. github.com/adam01110/nur
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677# This file provides all the buildable and cacheable packages and# package outputs in your package set. These are what gets built by CI,# so if you correctly mark packages as## - broken (using `meta.broken`),# - unfree (using `meta.license.free`), and# - locally built (using `preferLocalBuild`)## then your CI will be able to build and cache only those packages for# which this is possible.{pkgs ? import <nixpkgs> {}}: let inherit (builtins) # keep-sorted start all attrNames attrValues concatLists filter isAttrs isList listToAttrs # keep-sorted end ;
isReserved = n: n == "lib" || n == "overlays" || n == "modules"; isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; isBuildable = p: let licenseFromMeta = p.meta.license or []; licenseList = if isList licenseFromMeta then licenseFromMeta else [licenseFromMeta]; in !(p.meta.broken or false) && all (license: license.free or true) licenseList; isCacheable = p: !(p.preferLocalBuild or false); shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false;
nameValuePair = n: v: { name = n; value = v; };
concatMap = builtins.concatMap or (f: xs: concatLists (map f xs));
flattenPkgs = s: let f = p: if shouldRecurseForDerivations p then flattenPkgs p else if isDerivation p then [p] ++ (p.ciPackages or []) else []; in concatMap f (attrValues s);
outputsOf = p: map (o: p.${o}) p.outputs;
nurAttrs = import ./default.nix {inherit pkgs;};
nurPkgs = flattenPkgs (listToAttrs (map (n: nameValuePair n nurAttrs.${n}) (filter (n: !isReserved n) (attrNames nurAttrs))));in rec { # keep-sorted start buildPkgs = filter isBuildable nurPkgs; cachePkgs = filter isCacheable buildPkgs; # keep-sorted end
# keep-sorted start buildOutputs = concatMap outputsOf buildPkgs; cacheOutputs = concatMap outputsOf cachePkgs; # keep-sorted end}