mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
31 lines
739 B
Nix
31 lines
739 B
Nix
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE.
|
|
|
|
with import <nixpkgs> { };
|
|
|
|
with lib;
|
|
|
|
let
|
|
pkgs = import ./pkgs;
|
|
|
|
attrs = genAttrs
|
|
[ "aarch64" "i686" ]
|
|
(arch: (pkgs { 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
|
|
|
|
concatMap outputsOf cachePkgs
|