Commit graph

24 commits

Author SHA1 Message Date
eb4e2ffcaa Add VM configuration options and migrate to --block
- Rename `disks` to `additionalDisks` with structured format
  (path, readOnly, enableDiscard, blockSize, devIdentifier, useDirect)
- Add custom boot options: rootDisk, kernel, initramfs, rootDiskReadonly
- Add kernelParams for extra kernel command line options
- Add gpu option (default: "context-types=cross-domain:virgl2")
- Add sharedDirectories for crosvm --shared-dir
- Add global crosvmLogLevel option (default: "info")
- Add --name argument to crosvm set to VM name
- Migrate deprecated --disk/--rwdisk to --block format
- Switch flake to nixos-unstable channel

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 19:09:51 +00:00
3450465149 Bump crosvm (rebased on latest upstream) 2026-02-04 16:03:00 +00:00
1fcad4dca8 Add treefmt-nix formatter and clean up idiomatic Nix patterns
- Add treefmt-nix with nixfmt for code formatting (nix fmt)
- Extract cidrToNetworkBase and mkVmCase helper functions
- Use lib.nameValuePair for cleaner listToAttrs patterns
- Consolidate assertions with single let block
- Remove duplicate util-linux package
- Document formatting requirement in CLAUDE.md
- Apply nixfmt to all Nix files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:02:43 +00:00
45ffac9190 Update crosvm GPU seccomp policy to fix segfaults
Allow madvise(MADV_NOHUGEPAGE), setsockopt and sendmmsg. nvidia driver
calls XOpenDisplay which triggers DNS resolution so these are needed.
2026-02-04 11:09:51 +00:00
7274fafbdc Force server-side decorations
Use my wayland-proxy-virtwl fork. Unconditionally requests server-side
decorations even if the client doesn't want them.

Tested with firefox, works there.
2026-02-04 09:39:57 +00:00
62ab0476b8 refactor: remove legacy s6-based rootfs implementation
Remove the old s6/execline-based rootfs in favor of the NixOS module approach:

- Delete rootfs/ directory (s6-based rootfs builder)
- Delete mktuntap/ directory (TAP utility, now using --tap-name)
- Delete default.nix (legacy package with vs*/tt*/ff* scripts)
- Update flake.nix to point packages.default to rootfs-nixos
- Update documentation to reflect NixOS-only architecture

The NixOS module (modules/) with socket-activated VMs is now the only
supported approach. VMs are configured declaratively via
programs.qubes-lite.nixosVms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 02:09:10 +00:00
eb758f1892 Add declarative NixOS module for VM configuration
Replace the simple guestPrograms-only module with a full declarative
module that allows configuring VMs from configuration.nix:

- programs.qubes-lite.enable, user, vmNetwork, natEnable, natInterface
- programs.qubes-lite.nixosVms list with per-VM config (id, name,
  memory, cpus, network, disks, guestPrograms, guestConfig)
- Automatic TAP interface creation via networking.interfaces
- NAT configuration for VM internet access
- Per-VM NixOS rootfs builds with combined packages
- Generated launcher scripts (qubes-lite-start-<name>)
- run-in-vm helper for executing commands via vsock
- Systemd user services for each VM
- Validation: odd IDs 3-255, unique IDs/names
2026-02-03 23:09:56 +00:00
c50b309807 WIP: Add rootfs-nixos package for NixOS-based VM images
Adds a new rootfs-nixos/ package that builds a NixOS system into a
qcow2 image with overlayfs root (read-only ext4 + tmpfs upper).
2026-02-03 21:32:14 +00:00
b46e11d551 Use my crosvm fork for nVidia compat, home paths 2026-02-03 19:18:07 +00:00
Thomas Leonard
76c845a22f Update to NixOS 25.11
Changes needed:

- Some minor renaming for nixpkgs changes.
- Kernel modules now come from a separate output.
- dash over vsock seems to be broken; switched to bash.
  (it seems to be trying to use the console instead of the vsock)
2025-12-01 12:24:02 +00:00
Thomas Leonard
6bb8e07552 Allow configuring guest packages 2025-11-19 12:12:03 +00:00
Thomas Leonard
8f24386f06 Update to nixos-25.05 stable branch 2025-05-24 09:12:41 +01:00
Thomas Leonard
e7514f2358 Update to nixos 25.05 beta 2025-05-17 10:02:59 +01:00
Thomas Leonard
57e84cceef Update to NixOS 24.11 2024-12-28 16:20:03 +00:00
Thomas Leonard
a5ae46c4ee Update to NixOS 24.05 2024-06-17 11:16:08 +01:00
Thomas Leonard
0c9ce8f2dd Update crosvm to r124
Requires new wayland proxy, as the protocol changed
(https://github.com/talex5/wayland-proxy-virtwl/pull/77).
2024-04-08 16:49:50 +01:00
Thomas Leonard
090c8c9c8f Update Linux and crosvm 2024-04-07 12:27:41 +01:00
Thomas Leonard
9b7f33afc6 Update to latest Wayland proxy 2024-03-26 14:31:37 +00:00
Thomas Leonard
50b9cd446b Update to NixOS 23.11
Had to enable dbus as xfce4-terminal no longer works without a dbus
configuration service (it defaults to an unusable font and you can't
change it).

`chmod a+rw /dev/vsock` avoids a warning from socat, although it seems
to work OK without it.

`/run/current-system/sw/bin` is used by dbus-launch.
2023-11-28 15:00:24 +00:00
Thomas Leonard
36078f5bfe Update crosvm and proxy for updated protocol
See https://github.com/talex5/wayland-proxy-virtwl/pull/71
2023-11-04 11:39:26 +00:00
Thomas Leonard
475fff9564 Update to NixOS 23.05 2023-06-01 17:35:36 +01:00
Thomas Leonard
873e2f3630 Use NixOS 22.11 linuxPackages_latest as kernel 2023-01-28 13:30:40 +00:00
Thomas Leonard
6b66313cd3 Upgrade to newer crosvm 2022-11-11 12:32:29 +00:00
Thomas Leonard
9d3cdb3242 Convert to flake 2022-11-02 09:51:50 +00:00