Skip to content

Commit 5fc918b

Browse files
committed
refactor(virt): gate colima service on Darwin; adapt vmType per arch; add docker-compose
- Wrap services.colima with lib.mkIf hostPlatform.isDarwin so the module is a no-op on NixOS/Linux guests - Drop isActive (deprecated field) from the default profile - Set vmType = "vz" on aarch64 (Apple Virtualization.framework) and fall back to "qemu" on x86_64 for compatibility - Add docker-compose to the package list alongside docker/lazydocker
1 parent d9626f7 commit 5fc918b

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

home/tools/virt.nix

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
pkgs,
33
lib,
44
config,
5+
hostPlatform,
56
...
67
}: {
7-
# Enable colima as a service with docker runtime
8-
services.colima = {
8+
# colima manages Lima VMs; macOS-only (launchd-backed)
9+
# isService = false → no launchd agent; start manually with `colima start`
10+
services.colima = lib.mkIf hostPlatform.isDarwin {
911
enable = true;
1012
colimaHomeDir = "${config.xdg.configHome}/colima";
1113
coreutilsPackage = pkgs.uutils-coreutils;
1214
profiles.default = {
13-
isActive = true;
1415
isService = false;
1516
settings = {
16-
# Container runtime
1717
runtime = "docker";
1818

1919
cpu = 6;
2020
memory = 6;
2121
disk = 10;
2222

23-
# Disable kubernetes
2423
kubernetes.enabled = false;
2524

26-
# VM settings
27-
vmType = "vz"; # Apple Virtualization.framework (faster on Apple Silicon)
28-
autoActivate = true;
25+
# vz: Apple Virtualization.framework — native on Apple Silicon (macOS 12+),
26+
# requires macOS 13 on Intel; fall back to qemu on x86 for compatibility.
27+
vmType =
28+
if hostPlatform.isAarch64
29+
then "vz"
30+
else "qemu";
2931
};
3032
};
3133
};
@@ -36,6 +38,7 @@
3638
### container management
3739
## docker
3840
docker
41+
docker-compose
3942
lazydocker
4043
## kubernetes
4144
kubectl

0 commit comments

Comments
 (0)