Commit graph

54 commits

Author SHA1 Message Date
Jörg Thalheim
1d864e0ded template: simplify with forAllSystems and inline module
Use the forAllSystems pattern to reduce duplication and inline the
NixOS module directly in nixosSystem call. This eliminates the need for
separate nixosModules and nixosConfigurations outputs, making the
template more concise and easier to understand.

Also use virtualisation.munix namespace for the option.
2025-12-15 16:48:58 +01:00
Jörg Thalheim
ced0559be8 nixos: add munix.defaultCommand option and system.build.munix
Add a NixOS option to configure the default command for the VM and
provide a system.build.munix output that wraps munix with the correct
toplevel and default command. This reduces boilerplate in downstream
flakes since they no longer need to manually wrap munix.

The template now uses these new features, significantly simplifying
the apps definition.
2025-12-15 16:24:56 +01:00
Jörg Thalheim
2d721419e6 readme: move example to flake template
Replace inline flake.nix example with a proper flake template that users
can instantiate with `nix flake init`. This makes it easier to get
started and we can easier test the example.
2025-12-15 16:12:56 +01:00
Val Packett
fb53769c7a readme: add basic initial example of defining a vm (fix #8)
Starting point to simplify
2025-12-09 06:45:30 -03:00
Val Packett
ab5f412524 Add dconf to testvm
Pretty much required by GTK apps
2025-12-09 06:41:09 -03:00
Val Packett
20e7e88e07 Update sidebus (now reverse-client to a session bus in the guest) 2025-12-09 06:41:01 -03:00
Val Packett
bfb8352c55 nix: update sidebus (unhardcode user/group IDs) 2025-12-05 05:00:27 -03:00
Val Packett
cc135479ef systemd: chown XDG_RUNTIME_DIR again
This was temporarily gone due to refactorings (throwing out tmpfiles).
2025-12-05 04:09:40 -03:00
Val Packett
bfc037e615 systemd: hoist XDG_RUNTIME_DIR up to manager defaults
In some cases it might be needed in arbitrary services.. such as mpd
needing PipeWire to play sound into
2025-12-05 04:08:46 -03:00
Val Packett
73d2501781 systemd: use sockets.target
This allows using normal nix-managed services that register sockets for
lazy activation. Also brings in some red errors about starting services
that we don't have, but that will be fixed
2025-12-05 04:07:04 -03:00
Val Packett
fd771dd95f munix: make the default command overridable via env
This is convenient for app launch wrappers that would want to set their
own default command but still allow overriding it
2025-12-05 04:06:05 -03:00
Val Packett
2a98ae83af nix: update libkrun (aarch64 fixes) 2025-12-05 00:31:09 -03:00
Val Packett
d2070a1bec nix: set system.switch.enable = false
Will be required by the upstreamed static userborn, and shouldn've been
part of the initial research anyway :)
2025-12-05 00:09:03 -03:00
Val Packett
5f1783b9bb nix: update flake comment to mention --override-input 2025-12-05 00:08:30 -03:00
Jörg Thalheim
c7ec9872ca fix: disable systemd-resolved (not needed, DNS comes from host via passt) 2025-12-04 23:59:42 -03:00
Jörg Thalheim
57b8ae3424 switch from git submodules to flake inputs 2025-12-04 23:59:33 -03:00
Val Packett
6e8e4b9fda nix: replace pkgs.system with pkgs.stdenv.hostPlatform.system
evaluation warning: ‘system’ has been renamed to/replaced by ‘stdenv.hostPlatform.system’
2025-12-04 23:52:14 -03:00
Val Packett
7aa9f614da systemd: get udevd out of the critical chain
We don't need to wait for it at all
2025-12-04 23:48:17 -03:00
Val Packett
9a6cf18cc1 micro-activate: x86_64 type fix 2025-12-04 07:24:41 -03:00
Val Packett
0bd986f97f Introduce micro-activate (RIIR activate script + tiny bit of tmpfiles)
Instead of interpreting all that shell and running actual tmpfiles, use
a tiny stage before systemd that mounts a tmpfs at /run (preventing
systemd from doing the same), populates it with NixOS symlinks and
preserved resolv.conf, and mounts the immutable /etc overlay before
passing control over to systemd.
2025-12-04 07:17:31 -03:00
Val Packett
3d2f6c4732 systemd: disable generate-shutdown-ramfs 2025-12-04 06:59:40 -03:00
Val Packett
a93ab32aea Pass MESA_LOADER_DRIVER_OVERRIDE to muvm-remote
The Zink override for Venus in muvm was being eaten by systemd.. until now
2025-11-28 03:55:50 -03:00
Val Packett
f831c9d958 Update nixpkgs / dependencies (mesa-25.3.0)
Almost no need to touch mesa anymore.. except for the radeon virtio flag
2025-11-28 02:13:20 -03:00
Val Packett
9b23ae8094 gitignore testvm 2025-11-28 02:13:20 -03:00
Val Packett
93ba3d8fc4 Switch from sysusers to new "baked" userborn usage
Avoid spending ~100ms of userspace boot time on unnecessary regeneration
of entirely static /etc/{passwd,group,shadow}. This will be proposed to nixpkgs.
2025-11-28 02:13:20 -03:00
Val Packett
bd6307ded5 Symlink resolv.conf and machine-id instead of mounting
Works fine after all. Let's avoid mount calls to boot faster.
2025-11-28 02:13:20 -03:00
Val Packett
83db4d6074 Remove leftover debug env invocation 2025-11-28 02:13:20 -03:00
Val Packett
87691a5747 Do not wait for udev to settle
Relying on udev to assign permissions to the virtgpu was very "proper"
but really excessive. We have a simple static configuration, built into
the kernel, so there are no dynamic shenanigans, we can always reliably
just chmod/chown the permissions. Let's go back to faster booting.
2025-11-28 02:13:20 -03:00
Val Packett
73fdfca030 Update muvm fork (proper pwbridge fix) 2025-11-28 02:13:20 -03:00
Val Packett
23b91f1d6d Update libkrun and libkrunfw to latest upstream (merged MS_SHARED and EROFS) 2025-11-28 02:13:20 -03:00
Val Packett
59137223a9 Add fallback to our mesa package for non-NixOS hosts 2025-11-28 02:13:20 -03:00
Val Packett
c164db06c1 Fix msm driver name to msm_dpu 2025-11-27 21:58:53 -03:00
Val Packett
77028b04da Add error messages for missing muvm/passt 2025-11-27 20:33:30 -03:00
Val Packett
9f0f835fce Add sidebus integration 2025-11-14 06:20:44 -03:00
Val Packett
030503f23b Unhardcode x86_64 in virtwl package 2025-11-14 06:17:34 -03:00
Val Packett
8d2596d7cc testvm: add a couple more test tools 2025-11-14 02:11:11 -03:00
Val Packett
8d178b21ef Temporarily fork libkrun to add systemd mount propagation fix 2025-11-14 02:10:19 -03:00
Val Packett
d8d531aa00 Fix tmpfiles entry for runtime dir 2025-11-14 02:09:04 -03:00
Val Packett
7c0825b46c Update muvm with PipeWire fix
See https://github.com/AsahiLinux/muvm/pull/204
2025-11-07 06:11:10 -03:00
Jörg Thalheim
f295e7b32a README: document pipewire not working 2025-11-03 18:05:16 +01:00
Jörg Thalheim
181e675f02 munix: run realpath on nixos closure before running
this is more convinent when using `nix build`.
2025-11-03 17:57:14 +01:00
Jörg Thalheim
c32be2f8c8 README: add usage information 2025-11-03 17:56:25 +01:00
Jörg Thalheim
b70a166e8b add binary cache 2025-11-03 17:36:02 +01:00
Jörg Thalheim
505e85b9c5 flake.nix: extract packages/devshells/modules into smaller files 2025-11-03 17:22:41 +01:00
Jörg Thalheim
6f7f3f2461 Restrict flake to Linux systems and enable allowUnfree for nixosConfigurations
This project is Linux-specific (microVMs, libkrun, systemd, etc.), so
the flake now only exports packages and checks for x86_64-linux and
aarch64-linux systems. This prevents Darwin build failures.

Additionally, nixosConfigurations now set allowUnfree = true to allow
packages like zerotierone that have unfree licenses.
2025-11-03 16:24:04 +01:00
Jörg Thalheim
46edb4b7e9 Add flake checks for CI/CD validation
This adds a checks attribute to enable automated validation of all
build outputs. Checks are included for all packages, devShells, and
nixosConfigurations, with appropriate prefixes (package-, devShell-,
nixos-) for clarity and organization.
2025-11-03 15:45:54 +01:00
Jörg Thalheim
348cedab1a Refactor testvm into reusable nixosModule for multiple architectures
This extracts the testvm configuration into a shared nixosModules.testvm
module that can be reused across different architectures. The module is
now used by both testvm-x86_64 and testvm-aarch64 nixosConfigurations,
eliminating code duplication.

Additionally, nixosConfigurations have been moved to the top-level flake
outputs to follow Nix conventions, rather than being nested inside
eachDefaultSystem. The virtwl proxy reference now uses ${pkgs.system}
instead of hardcoded x86_64-linux to support both architectures.
2025-11-03 15:45:47 +01:00
Val Packett
790dd0d1f4 Integrate systemd
Not fully optimized yet, but shouldn't have any regressions
2025-10-31 04:53:19 -03:00
Val Packett
c4d462ea20 Update muvm 2025-10-03 01:37:22 -03:00
Val Packett
146430d8cd Add '--' arg separator 2025-09-26 06:09:41 -03:00