mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Filter derivation with preferLocalBuild
This commit is contained in:
parent
8359c22d96
commit
5d176845bf
1 changed files with 23 additions and 3 deletions
26
ci.nix
26
ci.nix
|
|
@ -3,10 +3,30 @@
|
||||||
|
|
||||||
with import <nixpkgs> { };
|
with import <nixpkgs> { };
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
src = import ./src;
|
src = import ./src;
|
||||||
|
|
||||||
|
attrs = genAttrs
|
||||||
|
[ "aarch64" "i686" ]
|
||||||
|
(arch: (src { inherit arch; }) // { recurseForDerivations = true; });
|
||||||
|
|
||||||
|
isCacheable = p: !(p.preferLocalBuild or false);
|
||||||
|
shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false;
|
||||||
|
|
||||||
|
flattenPkgs = s:
|
||||||
|
let
|
||||||
|
f = p:
|
||||||
|
if shouldRecurseForDerivations p then flattenPkgs p
|
||||||
|
else if isDerivation p then [ p ]
|
||||||
|
else [ ];
|
||||||
|
in
|
||||||
|
concatMap f (attrValues s);
|
||||||
|
|
||||||
|
cachePkgs = filter isCacheable (flattenPkgs attrs);
|
||||||
|
|
||||||
|
outputsOf = p: map (o: p.${o}) p.outputs;
|
||||||
in
|
in
|
||||||
|
|
||||||
lib.genAttrs
|
concatMap outputsOf cachePkgs
|
||||||
[ "aarch64" "i686" ]
|
|
||||||
(arch: (src { inherit arch; }) // { recurseForDerivations = true; })
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue