From e68af805bc1714368985d6d307e8c62ea847372a Mon Sep 17 00:00:00 2001 From: nicco Date: Thu, 12 Nov 2026 10:36:07 +0100 Subject: [PATCH 1/4] chore: update --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index c626f85..183f7af 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1793193205, - "narHash": "sha256-X6xa6sGA7RnJQuZGbFMC+K+KToWAlBDCCjJXfTwEPsw=", + "lastModified": 1794278858, + "narHash": "sha256-rkrJwLgLSHBnXfgoSKIDa+2LLGdTqynsV3GAxOTGhUU=", "owner": "nix-community", "repo": "home-manager", - "rev": "095fef2f265c3c0da4fe315efba8f8a04495ab34", + "rev": "82ce401aa350502897c3f2e85f384d61cd3b0b6d", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1793350711, - "narHash": "sha256-3fSKSbUTFHMrn5VeyKNZMIwiRx3oK8rinHrMFMGVjcU=", + "lastModified": 1794445186, + "narHash": "sha256-1hFFvnRQIqNBYoPTBECVfemwjjO8LhEU4WxJDD29Yyk=", "owner": "tw93", "repo": "mole", - "rev": "98b3e873396164fbb740c472de3187c8938c3b39", + "rev": "64daaf86499c7a7630224e3978096cbb5383b205", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1792737899, - "narHash": "sha256-P0/GhewcEQmAbzq3QunNWY2jLJaYH9F6c/5dEM/jQ4M=", + "lastModified": 1793418699, + "narHash": "sha256-+RpTlcdh9KqZ+ZiLkNSTvibQWm935EcIdBzRPCTFsrQ=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "bb0b90dbd54e207100de72b5dcbe3188c98a4b69", + "rev": "ff0e21a414d4547183396da1b44a66f2577b65e9", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1793225069, - "narHash": "sha256-sx1f99WGrDfJ83KKuQrqGPmot0rnDgmpLJDzpU2oHQQ=", + "lastModified": 1794285365, + "narHash": "sha256-wZbTou+ANeUoN7ojuMBOPU9D4qMZ96MLxcDp2BzmIUY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e62746b0b472753ef019baceab6f1e2e52014980", + "rev": "9ac0edc06bfb33e6c0000be79d98ef8d89e26503", "type": "github" }, "original": { From e56f08bf24cf8232ae5a9fda829bd62a2bca75e1 Mon Sep 17 00:00:00 2001 From: nicco Date: Mon, 16 Nov 2026 13:48:19 +0100 Subject: [PATCH 2/4] add colima --- common/home.nix | 1 - files/colima/colima.yaml | 288 +++++++++++++++++++++++++++++++++++++++ home/home.nix | 1 + 3 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 files/colima/colima.yaml diff --git a/common/home.nix b/common/home.nix index 0b66090..c4ac135 100644 --- a/common/home.nix +++ b/common/home.nix @@ -84,7 +84,6 @@ g = "lazygit"; d = "lazydocker"; k = "kubectl"; - colima-start = "colima start --cpu 4 --memory 8 --vm-type=vz --vz-rosetta"; }; }; diff --git a/files/colima/colima.yaml b/files/colima/colima.yaml new file mode 100644 index 0000000..ecfb108 --- /dev/null +++ b/files/colima/colima.yaml @@ -0,0 +1,288 @@ +# Number of CPUs to be allocated to the virtual machine. +# Default: 2 +cpu: 4 + +# Size of the disk in GiB to be allocated to the virtual machine for container data. +# NOTE: value can only be increased after virtual machine has been created. +# +# Default: 100 +disk: 100 + +# Size of the memory in GiB to be allocated to the virtual machine. +# Default: 2 +memory: 4 + +# Architecture of the virtual machine (x86_64, aarch64, host). +# +# NOTE: value cannot be changed after virtual machine is created. +# Default: host +arch: host + +# Container runtime to be used (docker, containerd). +# +# NOTE: value cannot be changed after virtual machine is created. +# Default: docker +runtime: docker + +# AI model runner (docker, ramalama). +# Both require krunkit VM type for GPU access. +# docker: Uses Docker Model Runner. +# ramalama: Uses Ramalama. +# +# Default: docker +modelRunner: "" + +# Set custom hostname for the virtual machine. +# Default: colima +# colima-profile_name for other profiles +hostname: colima + +# Kubernetes configuration for the virtual machine. +kubernetes: + # Enable kubernetes. + # Default: false + enabled: false + + # Kubernetes version to use. + # This needs to exactly match a k3s version https://github.com/k3s-io/k3s/releases + # Default: latest stable release + version: v1.33.3+k3s1 + + # Additional args to pass to k3s https://docs.k3s.io/cli/server + # Default: traefik is disabled + k3sArgs: + - --disable=traefik + + # Kubernetes port to listen on + # A common port is 6443, though left unbound to ensure no port conflicts + # Default: pick random unbound port + port: 0 + +# Auto-activate on the Host for client access. +# Setting to true does the following on startup +# - sets as active Docker context (for Docker runtime). +# - sets as active Kubernetes context (if Kubernetes is enabled). +# - sets as active Incus remote (for Incus runtime). +# Default: true +autoActivate: true + +# Network configurations for the virtual machine. +network: + # Assign reachable IP address to the virtual machine. + # NOTE: this is currently macOS only and ignored on Linux. + # Default: false + address: false + + # Network mode for the virtual machine (shared, bridged). + # NOTE: this is currently macOS only and ignored on Linux. + # Default: shared + mode: shared + + # Network interface to use for bridged mode. + # This is only used when mode is set to bridged. + # NOTE: this is currently macOS only and ignored on Linux. + # Default: en0 + interface: en0 + + # Use the assigned IP address as the preferred route for the VM. + # Note: this only has an effect when `address` is set to true. + # Default: false + preferredRoute: false + + # Custom DNS resolvers for the virtual machine. + # + # EXAMPLE + # dns: [8.8.8.8, 1.1.1.1] + # + # Default: [] + dns: [] + + # DNS hostnames to resolve to custom targets using the internal resolver. + # This setting has no effect if a custom DNS resolver list is supplied above. + # It does not configure the /etc/hosts files of any machine or container. + # The value can be an IP address or another host. + # + # EXAMPLE + # dnsHosts: + # example.com: 1.2.3.4 + dnsHosts: + host.docker.internal: host.lima.internal + + # Replicate host IP addresses in the VM. This enables port forwarding to specific + # host IP addresses. + # e.g. `docker run --port 10.0.1.2:8080:8080 alpine` would only forward to the + # specified IP address. + # + # Default: false + hostAddresses: false + + # Custom gateway address for the virtual machine. + # The last octet needs to be 2. + # + # EXAMPLE + # gatewayAddress: 192.168.10.2 + # + # Default: 192.168.5.2 + gatewayAddress: null + +# ===================================================================== # +# ADVANCED CONFIGURATION +# ===================================================================== # + +# Forward the host's SSH agent to the virtual machine. +# Default: false +forwardAgent: false + +# Docker daemon configuration that maps directly to daemon.json. +# https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file. +# NOTE: some settings may affect Colima's ability to start docker. e.g. `hosts`. +# +# EXAMPLE - disable buildkit +# docker: +# features: +# buildkit: false +# +# EXAMPLE - add insecure registries +# docker: +# insecure-registries: +# - myregistry.com:5000 +# - host.docker.internal:5000 +# +# Colima default behaviour: buildkit enabled +# Default: {} +docker: {} + +# Virtual Machine type (krunkit, qemu, vz) +# NOTE: this is macOS 13 only. For Linux and macOS <13.0, qemu is always used. +# +# vz is macOS virtualization framework and requires macOS 13. +# krunkit runs super‑light VMs on macOS/ARM64 with a focus on GPU access. It is experimental. +# +# NOTE: value cannot be changed after virtual machine is created. +# Default: qemu +vmType: qemu + +# Port forwarder for the virtual machine (ssh, grpc, none). +# ssh is more stable but supports only TCP. +# grpc supports both TCP and UDP, but is experimental. +# none disables port forwarding. +# +# Default: ssh +portForwarder: ssh + +# Utilise rosetta for amd64 emulation (requires m1 mac and vmType `vz`) +# Default: false +rosetta: false + +# Enable foreign architecture emulation via binfmt (e.g. amd64 on arm64, arm64 on amd64) +# Default: true +binfmt: true + +# Enable nested virtualization for the virtual machine (requires m3 mac and vmType `vz`) +# Default: false +nestedVirtualization: false + +# Volume mount driver for the virtual machine (virtiofs, 9p, sshfs). +# +# virtiofs is limited to macOS and vmType `vz`. It is the fastest of the options. +# +# 9p is the recommended and the most stable option for vmType `qemu`. +# +# sshfs is faster than 9p but the least reliable of the options (when there are lots +# of concurrent reads or writes). +# +# NOTE: value cannot be changed after virtual machine is created. +# Default: virtiofs (for vz), sshfs (for qemu) +mountType: sshfs + +# Propagate inotify file events to the VM. +# NOTE: this is experimental. +mountInotify: false + +# The CPU type for the virtual machine (requires vmType `qemu`). +# Options available for host emulation can be checked with: `qemu-system-$(arch) -cpu help`. +# Instructions are also supported by appending to the cpu type e.g. "qemu64,+ssse3". +# Default: host +cpuType: host + +# Custom provision scripts for the virtual machine. +# Provisioning scripts are executed on startup and therefore needs to be idempotent. +# +# EXAMPLE - script executed as root +# provision: +# - mode: system +# script: apt-get install htop vim +# +# EXAMPLE - script executed as user +# provision: +# - mode: user +# script: | +# [ -f ~/.provision ] && exit 0; +# echo provisioning as $USER... +# touch ~/.provision +# +# EXAMPLE - script executed after VM boot, before container runtimes start +# provision: +# - mode: after-boot +# script: echo "VM is up, containers not yet started" +# +# EXAMPLE - script executed after VM and container runtimes are ready +# provision: +# - mode: ready +# script: echo "everything is ready" +# +# Default: [] +provision: [] + +# Modify ~/.ssh/config automatically to include a SSH config for the virtual machine. +# SSH config will still be generated in $COLIMA_HOME/ssh_config regardless. +# Default: true +sshConfig: true + +# The port number for the SSH server for the virtual machine. +# When set to 0, a random available port is used. +# +# Default: 0 +sshPort: 0 + +# Configure volume mounts for the virtual machine. +# Colima mounts user's home directory by default to provide a familiar +# user experience. +# +# EXAMPLE +# mounts: +# - location: ~/secrets +# writable: false +# - location: ~/projects +# writable: true +# +# Colima default behaviour: $HOME is mounted as writable. +# Default: [] +mounts: [] + +# Specify a custom disk image for the virtual machine. +# When not specified, Colima downloads an appropriate disk image from Github at +# https://github.com/abiosoft/colima-core/releases. +# The file path to a custom disk image can be specified to override the behaviour. +# +# Default: "" +diskImage: "" + +# Use the custom disk image even if it does NOT match a supported release image. +# WARNING: This bypasses validating the image and is a completely unsupported! +forceDiskImage: false + +# Size of the disk in GiB for the root filesystem of the virtual machine. +# This value is ignored if no runtime is in use. i.e. `none` runtime. +# Default: 20 +rootDisk: 20 + +# Environment variables for the virtual machine. +# +# EXAMPLE +# env: +# KEY: value +# ANOTHER_KEY: another value +# +# Default: {} +env: {} diff --git a/home/home.nix b/home/home.nix index 4ddc159..e7be2fc 100644 --- a/home/home.nix +++ b/home/home.nix @@ -27,6 +27,7 @@ let file = { # Writable symlinks into the repo ".config/zed" = link "secrets/zed"; + ".colima/default/colima.yaml" = link "files/colima/colima.yaml"; ".agents" = link "files/agents"; ".config/opencode/AGENTS.md" = link "secrets/opencode/AGENTS.md"; From 59118ef4462be0b0d7f0367b3a033fc3ea231818 Mon Sep 17 00:00:00 2001 From: nicco Date: Mon, 16 Nov 2026 13:57:34 +0100 Subject: [PATCH 3/4] fix colima setup --- files/colima/colima.yaml | 26 +++++++++++++------------- home/home.nix | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/files/colima/colima.yaml b/files/colima/colima.yaml index ecfb108..5b8c9b2 100644 --- a/files/colima/colima.yaml +++ b/files/colima/colima.yaml @@ -10,7 +10,7 @@ disk: 100 # Size of the memory in GiB to be allocated to the virtual machine. # Default: 2 -memory: 4 +memory: 8 # Architecture of the virtual machine (x86_64, aarch64, host). # @@ -42,17 +42,17 @@ kubernetes: # Enable kubernetes. # Default: false enabled: false - + # Kubernetes version to use. # This needs to exactly match a k3s version https://github.com/k3s-io/k3s/releases # Default: latest stable release version: v1.33.3+k3s1 - + # Additional args to pass to k3s https://docs.k3s.io/cli/server # Default: traefik is disabled k3sArgs: - --disable=traefik - + # Kubernetes port to listen on # A common port is 6443, though left unbound to ensure no port conflicts # Default: pick random unbound port @@ -72,23 +72,23 @@ network: # NOTE: this is currently macOS only and ignored on Linux. # Default: false address: false - + # Network mode for the virtual machine (shared, bridged). # NOTE: this is currently macOS only and ignored on Linux. # Default: shared mode: shared - + # Network interface to use for bridged mode. # This is only used when mode is set to bridged. # NOTE: this is currently macOS only and ignored on Linux. # Default: en0 interface: en0 - + # Use the assigned IP address as the preferred route for the VM. # Note: this only has an effect when `address` is set to true. # Default: false preferredRoute: false - + # Custom DNS resolvers for the virtual machine. # # EXAMPLE @@ -96,7 +96,7 @@ network: # # Default: [] dns: [] - + # DNS hostnames to resolve to custom targets using the internal resolver. # This setting has no effect if a custom DNS resolver list is supplied above. # It does not configure the /etc/hosts files of any machine or container. @@ -107,7 +107,7 @@ network: # example.com: 1.2.3.4 dnsHosts: host.docker.internal: host.lima.internal - + # Replicate host IP addresses in the VM. This enables port forwarding to specific # host IP addresses. # e.g. `docker run --port 10.0.1.2:8080:8080 alpine` would only forward to the @@ -115,7 +115,7 @@ network: # # Default: false hostAddresses: false - + # Custom gateway address for the virtual machine. # The last octet needs to be 2. # @@ -160,7 +160,7 @@ docker: {} # # NOTE: value cannot be changed after virtual machine is created. # Default: qemu -vmType: qemu +vmType: vz # Port forwarder for the virtual machine (ssh, grpc, none). # ssh is more stable but supports only TCP. @@ -193,7 +193,7 @@ nestedVirtualization: false # # NOTE: value cannot be changed after virtual machine is created. # Default: virtiofs (for vz), sshfs (for qemu) -mountType: sshfs +mountType: virtiofs # Propagate inotify file events to the VM. # NOTE: this is experimental. diff --git a/home/home.nix b/home/home.nix index e7be2fc..0ec401c 100644 --- a/home/home.nix +++ b/home/home.nix @@ -27,7 +27,7 @@ let file = { # Writable symlinks into the repo ".config/zed" = link "secrets/zed"; - ".colima/default/colima.yaml" = link "files/colima/colima.yaml"; + ".colima/_templates/default.yaml" = link "files/colima/colima.yaml"; ".agents" = link "files/agents"; ".config/opencode/AGENTS.md" = link "secrets/opencode/AGENTS.md"; From 48606a2869a292fe904e0c8e710d3a274a128c6a Mon Sep 17 00:00:00 2001 From: nicco Date: Mon, 16 Nov 2026 13:57:40 +0100 Subject: [PATCH 4/4] update flake --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 183f7af..b77ad16 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1794278858, - "narHash": "sha256-rkrJwLgLSHBnXfgoSKIDa+2LLGdTqynsV3GAxOTGhUU=", + "lastModified": 1794715309, + "narHash": "sha256-awkBBs5ctFKgEYjpNGpi3t/VqF589n5EWfdinRb2gNI=", "owner": "nix-community", "repo": "home-manager", - "rev": "82ce401aa350502897c3f2e85f384d61cd3b0b6d", + "rev": "a1293da7dd8e497e08d26173f97e2976b36a31ea", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1794445186, - "narHash": "sha256-1hFFvnRQIqNBYoPTBECVfemwjjO8LhEU4WxJDD29Yyk=", + "lastModified": 1794799779, + "narHash": "sha256-ASX2PlNoMvZuf9o/mZQw9+qwbqPw/SMU2a8DIZQDO6k=", "owner": "tw93", "repo": "mole", - "rev": "64daaf86499c7a7630224e3978096cbb5383b205", + "rev": "ee7be609c70a568d7bc386b1442963f47c6a33ed", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1794285365, - "narHash": "sha256-wZbTou+ANeUoN7ojuMBOPU9D4qMZ96MLxcDp2BzmIUY=", + "lastModified": 1794644783, + "narHash": "sha256-3GnIGIy15bMduoS9RnWqKTmsJLWThla42UFtm0S7+us=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9ac0edc06bfb33e6c0000be79d98ef8d89e26503", + "rev": "5d2b81a7a3be3e2f832879028e4d60abbf58e9a0", "type": "github" }, "original": {