ci: replace ci.nix with build of bootstrapZip

bootstrapZip builds all derivations transitively.
This commit is contained in:
Tobias Happ 2022-09-24 14:57:14 +02:00
parent eb56b2ec8a
commit 5e7ec08d1d
2 changed files with 9 additions and 29 deletions

View file

@ -1,4 +1,4 @@
name: Build ci.nix and push to cachix
name: Build bootstrap packages and push to cachix
on:
pull_request:
push:
@ -21,5 +21,11 @@ jobs:
name: nix-on-droid
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: Build ci.nix
run: nix-build ci.nix
- name: Build bootstrap zip
run: |
nix \
--log-format bar-with-logs \
--option keep-going true \
--show-trace \
build .#bootstrapZip \
--impure

26
ci.nix
View file

@ -1,26 +0,0 @@
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE.
with import <nixpkgs> { };
with lib;
let
pkgs = (import ./pkgs { }) // { 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 pkgs);
outputsOf = p: map (o: p.${o}) p.outputs;
in
concatMap outputsOf cachePkgs