From 560cd874a37396968aea0bd9abc54fb1122424b7 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sun, 21 Apr 2024 01:55:03 -0700 Subject: [PATCH] nixos/etc: fix using etc overlay on cross-compiled systems We need to run tooling from the build platform when generating the EROFS. --- nixos/modules/system/etc/etc.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix index 0411faee6ebb..87932075f367 100644 --- a/nixos/modules/system/etc/etc.nix +++ b/nixos/modules/system/etc/etc.nix @@ -64,14 +64,6 @@ let etcHardlinks = filter (f: f.mode != "symlink" && f.mode != "direct-symlink") etc'; - build-composefs-dump = pkgs.buildPackages.runCommand "build-composefs-dump.py" - { - buildInputs = [ pkgs.buildPackages.python3 ]; - } '' - install ${./build-composefs-dump.py} $out - patchShebangs --host $out - ''; - in { @@ -295,10 +287,12 @@ in system.build.etcMetadataImage = let etcJson = pkgs.writeText "etc-json" (builtins.toJSON etc'); - etcDump = pkgs.runCommand "etc-dump" { } "${build-composefs-dump} ${etcJson} > $out"; + etcDump = pkgs.runCommand "etc-dump" { } '' + ${lib.getExe pkgs.buildPackages.python3} ${./build-composefs-dump.py} ${etcJson} > $out + ''; in pkgs.runCommand "etc-metadata.erofs" { - nativeBuildInputs = [ pkgs.composefs pkgs.erofs-utils ]; + nativeBuildInputs = with pkgs.buildPackages; [ composefs erofs-utils ]; } '' mkcomposefs --from-file ${etcDump} $out fsck.erofs $out