summary refs log tree commit diff
path: root/host/rootfs/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-03-21 15:11:07 +0000
committerAlyssa Ross <hi@alyssa.is>2023-03-21 15:43:58 +0000
commit2a338f7e1abe182d1c0ec496540349d2084e9b4b (patch)
treeb8f1bb936fc1dbab7733487b96dbbaea5174b5fb /host/rootfs/default.nix
parent048fadd0a4bf8b29227dc67f39363305b84ff29a (diff)
downloadspectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.tar
spectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.tar.gz
spectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.tar.bz2
spectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.tar.lz
spectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.tar.xz
spectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.tar.zst
spectrum-2a338f7e1abe182d1c0ec496540349d2084e9b4b.zip
scripts/make-gpt.sh: use copy_file_range(2)
Before this change, a clean release/live "make -j4" had a median
runtime of 85 seconds.  Now, it's 37 seconds.  That much of a
reduction in iteration time is worth the extra complexity.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'host/rootfs/default.nix')
-rw-r--r--host/rootfs/default.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index 23e4b38..637c607 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -1,9 +1,18 @@
 # SPDX-License-Identifier: MIT
-# SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2021-2023 Alyssa Ross <hi@alyssa.is>
 # SPDX-FileCopyrightText: 2022 Unikie
 
 import ../../lib/eval-config.nix (
-{ config, src, ... }: let inherit (config) pkgs; in
+
+{ config, src
+, lseek ? import ../../tools/lseek { inherit config; }
+, ...
+}:
+
+let
+  inherit (config) pkgs;
+in
+
 pkgs.pkgsStatic.callPackage (
 
 { lib, stdenvNoCC, nixos, runCommand, writeReferencesToFile, s6-rc, tar2ext4
@@ -124,7 +133,7 @@ stdenvNoCC.mkDerivation {
   inherit src;
   sourceRoot = "source/host/rootfs";
 
-  nativeBuildInputs = [ s6-rc tar2ext4 ];
+  nativeBuildInputs = [ lseek s6-rc tar2ext4 ];
 
   MODULES_ALIAS = "${kernel}/lib/modules/${kernel.modDirVersion}/modules.alias";
   MODULES_ORDER = "${kernel}/lib/modules/${kernel.modDirVersion}/modules.order";