diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-10-09 11:40:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-11-13 23:58:55 +0000 |
commit | 2b0083087c127c5abbc8d694719fd6b94c2a9995 (patch) | |
tree | a7c20de4bfd3579ca0d4623959cd4215e6b9f1ad /vm/app/lynx/etc/s6-rc/lynx | |
parent | d30f0248583e523eddb716aa931489b11a44e3f6 (diff) | |
download | spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.tar spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.tar.gz spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.tar.bz2 spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.tar.lz spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.tar.xz spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.tar.zst spectrum-2b0083087c127c5abbc8d694719fd6b94c2a9995.zip |
img/app: extract from appvm-{lynx,catgirl}
This patch introduces a generic application VM image. It mounts a filesystem containing the application, and then launches a "run" script on that filesystem to start the application. The Nix store on the application filesystem is overlaid onto the generic Nix store, so shared paths don't have to be duplicated in the application filesystem. The "appvm" image is part of the Spectrum system — it lives on the root filesystem, not the user data partition. Users of course have the choice not to use the built in image if they don't want to, but this gives us a default to use for future features like starting VMs at runtime. Individual application VMs are now defined in a single Nix file each, using a VM builder function. I expect this is how Nix-based VMs would be defined in the user data partition, and then built with Nix into Spectrum VM configurations. The new top-level vm-lib directory is intended to be copied into user Nix expressions that build VMs, and therefore has to be usable standalone. User-defined VMs should not do any path deduplication with the system-provided base VM, so that the two can independently update Nixpkgs. But for VMs that are part of the system (which I consider the pre-built VMs to be, even though they're currently on the user data partition), we can safely deduplicate paths that we know to be present in the base image. So they go through vm/make-vm.nix, which is a wrapper around vm-lib/make-vm.nix that does this deduplication. Signed-off-by: Alyssa Ross <hi@alyssa.is> Message-Id: <20221009114036.463071-7-hi@alyssa.is>
Diffstat (limited to 'vm/app/lynx/etc/s6-rc/lynx')
-rwxr-xr-x | vm/app/lynx/etc/s6-rc/lynx/run | 27 | ||||
-rw-r--r-- | vm/app/lynx/etc/s6-rc/lynx/type | 1 | ||||
-rw-r--r-- | vm/app/lynx/etc/s6-rc/lynx/type.license | 2 |
3 files changed, 0 insertions, 30 deletions
diff --git a/vm/app/lynx/etc/s6-rc/lynx/run b/vm/app/lynx/etc/s6-rc/lynx/run deleted file mode 100755 index d0e7a83..0000000 --- a/vm/app/lynx/etc/s6-rc/lynx/run +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/execlineb -P -# SPDX-License-Identifier: EUPL-1.2+ -# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is> - -export TERM foot -export TERMINFO_DIRS /usr/share/terminfo -export TMPDIR /run - -backtick USER { id -un } -backtick HOME { - importas -i user USER - homeof $user -} - -importas -i home HOME -cd $home - -redirfd -u 0 /dev/hvc0 -fdmove -c 1 0 -fdmove -c 2 0 - -foreground { clear } -unexport ? - -# Run lynx, then a login shell to allow for debugging. -foreground { lynx https://spectrum-os.org/ } -exec -l sh diff --git a/vm/app/lynx/etc/s6-rc/lynx/type b/vm/app/lynx/etc/s6-rc/lynx/type deleted file mode 100644 index 5883cff..0000000 --- a/vm/app/lynx/etc/s6-rc/lynx/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/vm/app/lynx/etc/s6-rc/lynx/type.license b/vm/app/lynx/etc/s6-rc/lynx/type.license deleted file mode 100644 index c49c11b..0000000 --- a/vm/app/lynx/etc/s6-rc/lynx/type.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 -SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is> |