From 4c4f8468f36f190e975a27024d665b24f2bb027c Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sun, 22 Sep 2019 15:52:10 -0400 Subject: [PATCH] depthcharge: Allows kpart to be built independently --- modules/system-types/depthcharge.nix | 6 +++--- systems/depthcharge/default.nix | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/system-types/depthcharge.nix b/modules/system-types/depthcharge.nix index 2514d780..7e1d26d8 100644 --- a/modules/system-types/depthcharge.nix +++ b/modules/system-types/depthcharge.nix @@ -4,7 +4,7 @@ let device_config = config.mobile.device; enabled = config.mobile.system.type == "depthcharge"; - disk-image = pkgs.callPackage ../../systems/depthcharge { + build = pkgs.callPackage ../../systems/depthcharge { inherit device_config; initrd = config.system.build.initrd; system = config.system.build.rootfs; @@ -16,9 +16,9 @@ in (lib.mkIf enabled { system.build = { - inherit disk-image; + inherit (build) disk-image kpart; # installer shortcut; it's a depthcharge disk-image build. - mobile-installer = disk-image; + mobile-installer = build.disk-image; }; }) ]; diff --git a/systems/depthcharge/default.nix b/systems/depthcharge/default.nix index 972ae798..72f299c3 100644 --- a/systems/depthcharge/default.nix +++ b/systems/depthcharge/default.nix @@ -109,10 +109,12 @@ let ]; }; in +{ + inherit kpart; # Takes the built image, and do some light editing using `cgpt`. # This uses some depthcharge-specific fields to make the image bootable. # FIXME : integrate into the makeGPT call with postBuild or something - runCommandNoCC "depthcharge-${device_name}" { nativeBuildInputs = [ vboot_reference ]; } '' + disk-image = runCommandNoCC "depthcharge-${device_name}" { nativeBuildInputs = [ vboot_reference ]; } '' # Copy the generated image... # Note that while it's GPT, it's lacking some depthcharge magic attributes cp ${image}/${name}.img ./ @@ -129,4 +131,5 @@ in mkdir -p $out cp ${name}.img $out/ - '' + ''; +}