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" ''; };