From: colbyt <colby@colbyt.com>
To: devel@spectrum-os.org
Cc: colbyt <colby@colbyt.com>
Subject: [PATCH 8/8] vm-lib: allow app VMs to name closure roots
Date: Fri, 26 Jun 2026 11:55:08 -0700 [thread overview]
Message-ID: <20260626185509.3715326-9-colby@colbyt.com> (raw)
In-Reply-To: <20260626185509.3715326-1-colby@colbyt.com>
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 +
| 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 ];
}) (_: {})
--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
next prev parent reply other threads:[~2026-06-26 18:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 18:55 [PATCH 0/8] refresh nixpkgs for Linux 7.1 colbyt
2026-06-26 18:55 ` [PATCH 1/8] pkgs: fix aarch64-musl builds with current nixpkgs colbyt
2026-07-02 12:18 ` Alyssa Ross
2026-06-26 18:55 ` [PATCH 2/8] lib: update nixpkgs colbyt
2026-06-26 18:55 ` [PATCH 3/8] pkgs/skaware: vendor backported patches colbyt
2026-07-02 11:53 ` Alyssa Ross
2026-06-26 18:55 ` [PATCH 4/8] pkgs/gtk3: skip integrated Wayland backport colbyt
2026-07-02 12:19 ` Alyssa Ross
2026-06-26 18:55 ` [PATCH 5/8] pkgs/skaware: skip integrated backports colbyt
2026-06-26 18:55 ` [PATCH 6/8] pkgs/cloud-hypervisor: update GPU patchset to v52 colbyt
2026-06-26 18:55 ` [PATCH 7/8] pkgs/libfyaml: fix pkg-config libs colbyt
2026-06-26 18:55 ` colbyt [this message]
2026-07-02 13:38 ` [PATCH 8/8] vm-lib: allow app VMs to name closure roots Alyssa Ross
2026-07-02 23:40 ` colby
2026-07-03 14:02 ` Alyssa Ross
2026-06-26 18:55 ` [PATCH optional] linux: use 6.18 for generic images colbyt
2026-07-02 13:42 ` Alyssa Ross
2026-07-02 23:20 ` colby
2026-07-02 12:03 ` [PATCH 0/8] refresh nixpkgs for Linux 7.1 Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260626185509.3715326-9-colby@colbyt.com \
--to=colby@colbyt.com \
--cc=devel@spectrum-os.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).