From e413688502b482694b9c4057055e15a83fc8265a Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 7 Feb 2017 23:40:13 +0100 Subject: modules/core: Add a new module for lazy packages This allows to add packages to vuizvui.lazyPackages which then aren't directly installed onto the system but instead built by the Hydra and only fetched from it as soon as a binary of one of these packages is executed. Doing this only within a NixOS module however isn't enough, because by default gc-keep-outputs is false, so a garbage collect on the Hydra instance would remove the packages we wrap in vuizvui.lazyPackages. Signed-off-by: aszlig --- release.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'release.nix') diff --git a/release.nix b/release.nix index 5591dcac..b71ad0c3 100644 --- a/release.nix +++ b/release.nix @@ -69,8 +69,19 @@ let in with pkgsUpstream.lib; with builtins; { machines = let - getBuild = const (getAttr "build"); - in mapAttrsRecursiveCond (m: !(m ? eval)) getBuild allMachines; + # We need to expose all the real builds within vuizvui.lazyPackages to make + # sure they don't get garbage collected on the Hydra instance. + wrapLazy = machine: pkgsUpstream.runCommand machine.build.name { + fakeRuntimeDeps = machine.eval.config.vuizvui.lazyPackages; + product = machine.build; + } '' + mkdir -p "$out/nix-support" + echo "$product" > "$out/nix-support/fake-runtime-dependencies" + for i in $fakeRuntimeDeps; do + echo "$i" >> "$out/nix-support/fake-runtime-dependencies" + done + ''; + in mapAttrsRecursiveCond (m: !(m ? eval)) (const wrapLazy) allMachines; isoImages = let buildIso = attrs: let -- cgit 1.4.1