From 9daa796b10a68fa16e979b4132691ee38cda5ac3 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 18 Sep 2024 11:41:20 +0200 Subject: [PATCH] Try to save a gcroot will build dependencies --- flake.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flake.nix b/flake.nix index 6df0a36..d4236b6 100644 --- a/flake.nix +++ b/flake.nix @@ -100,6 +100,16 @@ nixosconf = self.nixosConfigurations.lagarto-ox; syspkgs = nixosconf.pkgs; build = nixosconf.config.system.build; + + buildRoots = savePkgs: + let + pkgs = syspkgs; + buildInner = { package, attr }: pkgs.linkFarmFromDrvs "${package.name}.${attr}" package.${attr}; + in pkgs.linkFarmFromDrvs "top-level" (pkgs.lib.mapCartesianProduct buildInner { + package = savePkgs; + attr = [ "buildInputs" "nativeBuildInputs" ]; + }); + in syspkgs.mkShell { pname = "lagarto-ox-shell"; TOPLEVEL = build.toplevel; @@ -110,6 +120,7 @@ UBOOT_ENV = syspkgs.uboot-env; BITSTREAM = syspkgs.bitstream; BOOTROM = syspkgs.bootrom; + GCROOT = buildRoots [ build.toplevel build.kernel ]; shellHook = '' echo "Here are the current system pieces:" echo " TOPLEVEL = $TOPLEVEL" @@ -120,6 +131,7 @@ echo " UBOOT_ENV = $UBOOT_ENV" echo " BITSTREAM = $BITSTREAM" echo " BOOTROM = $BOOTROM" + echo " GCROOT = $GCROOT" ''; };