make-vm copies the closure of the run path into the image. For app VMs that use lib.getExe, that can miss files from the package output that owns the executable. Allow callers to pass explicit closure roots, and use the package derivations for the foot and Firefox app VMs. Signed-off-by: colbyt <colby@colbyt.com> --- vm-lib/make-vm.nix | 4 ++-- vm/app/firefox.nix | 1 + vm/app/foot.nix | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vm-lib/make-vm.nix b/vm-lib/make-vm.nix index 7847883..9f11bbd 100644 --- a/vm-lib/make-vm.nix +++ b/vm-lib/make-vm.nix @@ -14,7 +14,7 @@ pkgs.pkgsStatic.callPackage ( { lib, runCommand, writeClosure, erofs-utils }: -{ run, type, providers ? {}, sharedDirs ? {} }: +{ run, runClosure ? [ run ], type, providers ? {}, sharedDirs ? {} }: let inherit (lib) any attrValues concatLists hasInfix mapAttrsToList; @@ -38,7 +38,7 @@ runCommand "spectrum-vm" { echo ${type} > fs/type ln -s ${run} fs/run mkdir -p fs${builtins.storeDir} - comm -23 <(sort ${writeClosure [ run ]}) \ + comm -23 <(sort ${writeClosure runClosure}) \ <(sort ${writeClosure [ basePaths ]}) | xargs -rd '\n' cp -rvt fs${builtins.storeDir} diff --git a/vm/app/firefox.nix b/vm/app/firefox.nix index 164453c..6b84a30 100644 --- a/vm/app/firefox.nix +++ b/vm/app/firefox.nix @@ -8,4 +8,5 @@ callSpectrumPackage ../make-vm.nix {} { providers.net = [ "sys.netvm" ]; type = "nix"; run = lib.getExe firefox; + runClosure = [ firefox ]; }) (_: {}) diff --git a/vm/app/foot.nix b/vm/app/foot.nix index 332ccf4..62d7aba 100644 --- a/vm/app/foot.nix +++ b/vm/app/foot.nix @@ -7,4 +7,5 @@ import ../../lib/call-package.nix ( callSpectrumPackage ../make-vm.nix {} { type = "nix"; run = lib.getExe foot; + runClosure = [ foot ]; }) (_: {}) -- 2.54.0