Skip to content

Commit 377f8c8

Browse files
committed
kexec: reduce closure size
The tarball was referring to ncurses, icu and glibc, which blow up the image to 1.4-1.5GB. With these changes the tarball is shrinked back to ~700MB.
1 parent a9a316a commit 377f8c8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

kexec/kexec.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
executable = true;
1414
name = "kexec-nixos";
1515
text = ''
16-
#!${pkgs.stdenv.shell}
17-
export PATH=${pkgs.kexectools}/bin:${pkgs.cpio}/bin:$PATH
16+
#!${pkgs.pkgsMusl.busybox}/bin/sh
17+
export PATH=${pkgs.pkgsMusl.kexectools}/bin:${pkgs.pkgsMusl.busybox}/bin
1818
set -x
1919
set -e
2020
cd $(mktemp -d)
@@ -39,10 +39,12 @@
3939
mkdir -p /mnt-root/root/.ssh/
4040
cp /authorized_keys /mnt-root/root/.ssh/
4141
'';
42-
system.build.kexec_tarball = pkgs.callPackage <nixpkgs/nixos/lib/make-system-tarball.nix> {
42+
system.build.kexec_tarball = pkgs.callPackage (pkgs.path + "/nixos/lib/make-system-tarball.nix") {
4343
storeContents = [
4444
{ object = config.system.build.kexec_script; symlink = "/kexec_nixos"; }
4545
];
46-
contents = [];
46+
contents = [
47+
{ source = image; target = image; }
48+
];
4749
};
4850
}

0 commit comments

Comments
 (0)