From 5c1a3b619db5a664977f60cddd3280355d3888a5 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 15 Mar 2024 08:33:22 +0800 Subject: [PATCH] singularity-tools.buildImages: use writeClosure --- pkgs/build-support/singularity-tools/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/singularity-tools/default.nix b/pkgs/build-support/singularity-tools/default.nix index 8d7ad9e742a1..c9e53a4cb706 100644 --- a/pkgs/build-support/singularity-tools/default.nix +++ b/pkgs/build-support/singularity-tools/default.nix @@ -4,7 +4,7 @@ , storeDir ? builtins.storeDir , writeScript , singularity -, writeReferencesToFile +, writeClosure , bash , vmTools , gawk @@ -50,18 +50,13 @@ rec { }: let projectName = singularity.projectName or "singularity"; - layer = mkLayer { - inherit name; - contents = contents ++ [ bash runScriptFile ]; - inherit projectName; - }; runAsRootFile = shellScript "run-as-root.sh" runAsRoot; runScriptFile = shellScript "run-script.sh" runScript; result = vmTools.runInLinuxVM ( runCommand "${projectName}-image-${name}.img" { buildInputs = [ singularity e2fsprogs util-linux gawk ]; - layerClosure = writeReferencesToFile layer; + layerClosure = writeClosure contents; preVM = vmTools.createEmptyImage { size = diskSize; fullName = "${projectName}-run-disk";