Only save kernel and opensbi build inputs
This commit is contained in:
parent
9daa796b10
commit
877428c2fe
30
flake.nix
30
flake.nix
@ -8,6 +8,16 @@
|
|||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
nixosSystem = import (nixpkgs + "/nixos/lib/eval-config.nix");
|
nixosSystem = import (nixpkgs + "/nixos/lib/eval-config.nix");
|
||||||
|
buildRoots = { pkgs, save }:
|
||||||
|
let
|
||||||
|
buildInner = { package, attr }:
|
||||||
|
if (attr == "")
|
||||||
|
then pkgs.linkFarmFromDrvs "${package.name}" [ package ]
|
||||||
|
else pkgs.linkFarmFromDrvs "${package.name}.${attr}" package.${attr};
|
||||||
|
in pkgs.linkFarmFromDrvs "top-level" (pkgs.lib.mapCartesianProduct buildInner {
|
||||||
|
package = save;
|
||||||
|
attr = [ "" "buildInputs" "nativeBuildInputs" ];
|
||||||
|
});
|
||||||
in {
|
in {
|
||||||
#overlay = import ./overlay.nix;
|
#overlay = import ./overlay.nix;
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
@ -100,17 +110,7 @@
|
|||||||
nixosconf = self.nixosConfigurations.lagarto-ox;
|
nixosconf = self.nixosConfigurations.lagarto-ox;
|
||||||
syspkgs = nixosconf.pkgs;
|
syspkgs = nixosconf.pkgs;
|
||||||
build = nixosconf.config.system.build;
|
build = nixosconf.config.system.build;
|
||||||
|
in syspkgs.mkShell rec {
|
||||||
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";
|
pname = "lagarto-ox-shell";
|
||||||
TOPLEVEL = build.toplevel;
|
TOPLEVEL = build.toplevel;
|
||||||
OPENSBI = syspkgs.opensbi;
|
OPENSBI = syspkgs.opensbi;
|
||||||
@ -120,7 +120,7 @@
|
|||||||
UBOOT_ENV = syspkgs.uboot-env;
|
UBOOT_ENV = syspkgs.uboot-env;
|
||||||
BITSTREAM = syspkgs.bitstream;
|
BITSTREAM = syspkgs.bitstream;
|
||||||
BOOTROM = syspkgs.bootrom;
|
BOOTROM = syspkgs.bootrom;
|
||||||
GCROOT = buildRoots [ build.toplevel build.kernel ];
|
GCROOT = buildRoots { pkgs = syspkgs; save = [ KERNEL OPENSBI ]; };
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
echo "Here are the current system pieces:"
|
echo "Here are the current system pieces:"
|
||||||
echo " TOPLEVEL = $TOPLEVEL"
|
echo " TOPLEVEL = $TOPLEVEL"
|
||||||
@ -136,9 +136,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
devShells.x86_64-linux.lagarto-ox-rd =
|
devShells.x86_64-linux.lagarto-ox-rd =
|
||||||
self.outputs.devShells.x86_64-linux.lagarto-ox.overrideAttrs (old:{
|
let
|
||||||
|
nixosconf = self.nixosConfigurations.lagarto-ox;
|
||||||
|
syspkgs = nixosconf.pkgs;
|
||||||
|
in self.outputs.devShells.x86_64-linux.lagarto-ox.overrideAttrs (old:{
|
||||||
TOPLEVEL = "";
|
TOPLEVEL = "";
|
||||||
ROOTFS = "";
|
ROOTFS = "";
|
||||||
|
GCROOT = buildRoots { pkgs = syspkgs; save = [ old.OPENSBI ]; };
|
||||||
});
|
});
|
||||||
|
|
||||||
devShells.x86_64-linux.default =
|
devShells.x86_64-linux.default =
|
||||||
|
Loading…
Reference in New Issue
Block a user