Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ jobs:
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.samueles.activationPackage

hm-docker-x86:
hm-sandbox-amd64:
runs-on: ubuntu-24.04
steps:
- uses: cachix/install-nix-action@v31
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.agent-amd64.activationPackage

hm-docker-arm:
hm-ubuntu:
runs-on: ubuntu-24.04-arm
steps:
- uses: cachix/install-nix-action@v31
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.agent-arm64.activationPackage
- run: nix build --print-build-logs .#homeConfigurations."admin@ubuntu".activationPackage

hm-tart:
hm-tahoe-vanilla:
runs-on: macos-26
steps:
- uses: cachix/install-nix-action@v31
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.admin.activationPackage
- run: nix build --print-build-logs .#homeConfigurations."admin@tahoe-vanilla".activationPackage
16 changes: 8 additions & 8 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.samueles.activationPackage

hm-docker-x86:
hm-sandbox-amd64:
needs: lock
runs-on: ubuntu-24.04
steps:
Expand All @@ -66,7 +66,7 @@ jobs:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.agent-amd64.activationPackage

hm-docker-arm:
hm-ubuntu:
needs: lock
runs-on: ubuntu-24.04-arm
steps:
Expand All @@ -75,9 +75,9 @@ jobs:
- uses: actions/download-artifact@v8
with:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.agent-arm64.activationPackage
- run: nix build --print-build-logs .#homeConfigurations."admin@ubuntu".activationPackage

hm-tart:
hm-tahoe-vanilla:
needs: lock
runs-on: macos-26
steps:
Expand All @@ -86,17 +86,17 @@ jobs:
- uses: actions/download-artifact@v8
with:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.admin.activationPackage
- run: nix build --print-build-logs .#homeConfigurations."admin@tahoe-vanilla".activationPackage

pr:
needs:
- lock
- nixos
- hm-nixos
- hm-macos
- hm-docker-x86
- hm-docker-arm
- hm-tart
- hm-sandbox-amd64
- hm-ubuntu
- hm-tahoe-vanilla
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
Expand Down
20 changes: 0 additions & 20 deletions Dockerfile

This file was deleted.

68 changes: 32 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,9 @@ ln -s ~/github/samestep/env ~/.config/home-manager
nix run ~/github/samestep/env#home-manager switch
```

## Docker ([x86](docker-x86) and [ARM](docker-arm))
## [libvirt](sandbox-amd64)

This repo also contains dedicated Home Manager configs for use in an Ubuntu Docker container; for instance:

```sh
docker build . -t agent
docker create agent sleep infinity
```

Then in VS Code, start the container and [attach to it](https://code.visualstudio.com/docs/devcontainers/attach-container).

## [libvirt](docker-x86)

The Docker configs can also be used for virtual machines. First make sure you have [virt-manager](https://virt-manager.org/), virt-viewer, and the [libvirt NSS module](https://libvirt.org/nss.html) installed, as they are in this repo's NixOS config. Then make sure you've started the `default` network:
This config can also be used for x86 Linux virtual machines on Linux. First make sure you have [virt-manager](https://virt-manager.org/), virt-viewer, and the [libvirt NSS module](https://libvirt.org/nss.html) installed, as they are in this repo's NixOS config. Then make sure you've started the `default` network:

```sh
virsh -c qemu:///system net-start default
Expand Down Expand Up @@ -176,41 +165,42 @@ And run this repo's script to generate `~/.ssh/tailnet`:
tailnet
```

## [Lima](docker-arm)
## [Tart (Linux)](ubuntu)

Similarly, the ARM Linux config can be used for a Linux virtual machine on macOS, via [Lima](https://lima-vm.io/) which comes with the host-side macOS config in this repo. First create the VM:
This config can be used for ARM Linux virtual machines on macOS, via [Tart](https://tart.run/) which comes with the host-side macOS config in this repo. First, download an Ubuntu image:

- The username and home directory location must be set to match what this Home Manager config expects.
- Lima mounts the host-side home directory to the same path in the VM by default, so we disable that for security purposes.
- By default Lima only gives the VM [user-mode networking](https://lima-vm.io/docs/config/network/user-v2/) (a userspace TCP/IP stack on the host), and SSH reaches the VM via a port forward through that stack, which adds enough per-packet latency to make interactive SSH typing lag. We add a [`vzNAT`](https://lima-vm.io/docs/config/network/vmnet/) interface so the VM also gets a real IP on Apple's `vmnet` network (the same `192.168.64.0/24` network, and mechanism, that Tart uses), reachable directly from the host. SSH straight to that IP to get the low-latency path. This requires `vmType: vz`, which is the default on Apple Silicon.
- Nested virtualization is necessary for KVM to be available inside the VM.
```sh
tart clone ghcr.io/cirruslabs/ubuntu:latest ubuntu
```

By default, Tart doesn't give the VM all CPU cores, and only gives 8 GiB of RAM and 50 GB of disk space, so adjust those as appropriate:

```sh
limactl start --name sandbox-arm64 --cpus 18 --memory 32 --disk 2000 --set '.user.name = "agent-arm64" | .user.home = "/home/agent-arm64" | .mounts = [] | .networks = [{"vzNAT": true}] | .nestedVirtualization = true' template:ubuntu
tart set ubuntu --cpu 18 --memory 32768 --disk-size 2000
```

Then configure it to start automatically in the background:
Start up the VM:

```sh
limactl autostart enable sandbox-arm64
tart run --no-graphics ubuntu
```

Enable Lima's SSH setup:
Leave that running and, in a different terminal, give the VM your public SSH key give the VM your public SSH key so you don't need to type the password each time you connect:

```sh
echo 'Include ~/.lima/*/ssh.config' >> ~/.ssh/config
ssh-copy-id admin@$(tart ip ubuntu)
```

Then SSH into the new VM. The `lima-sandbox-arm64` alias enabled by the previous command is fine for things like Git remotes, but laggy for interactive SSH, so use the following command instead:
While adding the SSH key, you will need to type the password, which is `admin`. Then SSH into the VM:

```sh
ssh -i ~/.lima/_config/user agent-arm64@lima-sandbox-arm64.local
ssh admin@$(tart ip ubuntu)
```

That command will start squawking after a reboot unless you run the following in the VM:
Avoid ten-second hangs by enabling Ubuntu to resolve the local hostname:

```sh
echo 'ssh_deletekeys: false' | sudo tee /etc/cloud/cloud.cfg.d/99-keep-ssh-host-keys.cfg
echo "127.0.1.1 $(hostname)" | sudo tee -a /etc/hosts
```

Next, install Nix:
Expand All @@ -219,7 +209,13 @@ Next, install Nix:
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
```

Clone this repo:
Enable [flakes][]:

```sh
echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
```

After installing Nix you'll need to log back out and back in. Then clone this repo:

```sh
git clone https://github.com/samestep/env.git ~/github/samestep/env
Expand All @@ -228,7 +224,7 @@ git clone https://github.com/samestep/env.git ~/github/samestep/env
Make a symlink for Home Manager:

```sh
ln -fsT ~/github/samestep/env ~/.config/home-manager
mkdir -p ~/.config && ln -fsT ~/github/samestep/env ~/.config/home-manager
```

And activate the config:
Expand All @@ -246,7 +242,7 @@ curl -fsSL https://tailscale.com/install.sh | sh
Connect to the tailnet:

```sh
sudo tailscale up --ssh --hostname=sandbox-arm64
sudo tailscale up --ssh --hostname=ubuntu
```

And run this repo's script to generate `~/.ssh/tailnet`:
Expand All @@ -255,15 +251,15 @@ And run this repo's script to generate `~/.ssh/tailnet`:
tailnet
```

## [Tart](tart)
## [Tart (macOS)](tahoe-vanilla)

This config can be used for macOS VMs created with [Tart](https://tart.run/), which comes with the host-side macOS config in this repo. First, download a macOS image:
This config can be used for macOS VMs, again using [Tart](https://tart.run/). First, download a macOS image:

```sh
tart clone ghcr.io/cirruslabs/macos-tahoe-vanilla:latest tahoe-vanilla
```

By default, Tart doesn't give the VM all CPU cores, and only gives 8 GiB of RAM and 50 GB of disk space, so adjust those as appropriate:
Expand the provided CPU cores, RAM, and disk space:

```sh
tart set tahoe-vanilla --cpu 18 --memory 16384 --disk-size 1000
Expand Down Expand Up @@ -317,13 +313,13 @@ Now shut down the VM again and reboot it once more, this time without graphics:
tart run --no-graphics tahoe-vanilla
```

Leave that running and, in a different terminal, give the VM your public SSH key give the VM your public SSH key so you don't need to type the password each time you connect:
In a different terminal, give the VM your public SSH key, using the password `admin`:

```sh
ssh-copy-id admin@$(tart ip tahoe-vanilla)
```

While adding the SSH key, you will need to type the password, which is `admin`. Then SSH into the VM:
Then SSH into the VM:

```sh
ssh admin@$(tart ip tahoe-vanilla)
Expand Down
2 changes: 1 addition & 1 deletion agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ssh sandbox-amd64
For the `aarch64-linux` VM:

```sh
ssh sandbox-arm64
ssh ubuntu
```

For the `aarch64-darwin` VM:
Expand Down
2 changes: 1 addition & 1 deletion bin/tailnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import subprocess
from pathlib import Path

HOSTS = ["sandbox-amd64", "sandbox-arm64", "tahoe-vanilla"]
HOSTS = ["sandbox-amd64", "ubuntu", "tahoe-vanilla"]


def main():
Expand Down
12 changes: 0 additions & 12 deletions docker-arm/home-manager/home.nix

This file was deleted.

25 changes: 5 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,6 @@
commaOverlay
npc.overlays.default
moss.overlays.default
(final: prev: {
lima =
assert final.lib.assertMsg (final.lib.versionOlder prev.lima.version "2.2.0")
"Nixpkgs now ships Lima ${prev.lima.version} (>= 2.2.0); check if this fix is merged: https://github.com/lima-vm/lima/pull/5088";
prev.lima.overrideAttrs (old: {
version = "2.2.0-unstable-2026-07-02";
src = final.fetchFromGitHub {
owner = "resker";
repo = "lima";
rev = "f14b343a14f38490a76b9bac144fce1a3cf43d0b";
hash = "sha256-eyvz7XbZKUVQZdSVmDmYlHQSCKFE23OeIH4N4hNDg3M=";
};
vendorHash = "sha256-nwNDuE76fVncegDKI/Fztpc30NX8/shNbSfzkrwTPDk=";
});
})
];
};
modules = [
Expand All @@ -148,10 +133,10 @@
nix-index-database.homeModules.default
./modules/base.nix
./modules/yolo.nix
./docker-x86/home-manager/home.nix
./sandbox-amd64/home-manager/home.nix
];
};
"agent-arm64" = home-manager.lib.homeManagerConfiguration {
"admin@ubuntu" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
Expand All @@ -164,10 +149,10 @@
nix-index-database.homeModules.default
./modules/base.nix
./modules/yolo.nix
./docker-arm/home-manager/home.nix
./ubuntu/home-manager/home.nix
];
};
"admin" = home-manager.lib.homeManagerConfiguration {
"admin@tahoe-vanilla" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "aarch64-darwin";
overlays = [
Expand All @@ -180,7 +165,7 @@
nix-index-database.homeModules.default
./modules/base.nix
./modules/yolo.nix
./tart/home-manager/home.nix
./tahoe-vanilla/home-manager/home.nix
];
};
};
Expand Down
1 change: 0 additions & 1 deletion macos/home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

packages = [
pkgs.gh
pkgs.lima
pkgs.tart
];

Expand Down
4 changes: 0 additions & 4 deletions modules/vscode.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
vscode.llvm-vs-code-extensions.vscode-clangd
vscode.mkhl.direnv
vscode.moss-lang.moss-vscode
vscode.ms-azuretools.vscode-containers
vscode.ms-azuretools.vscode-docker
vscode.ms-python.python
vscode.ms-python.vscode-pylance
vscode.ms-vscode-remote.remote-containers
vscode.ms-vscode-remote.remote-ssh
vscode.ms-vscode.cmake-tools
vscode.myriad-dreamin.tinymist
vscode.ocamllabs.ocaml-platform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ ... }:
{
home = {
# # https://nix-community.github.io/home-manager/release-notes.xhtml
# https://nix-community.github.io/home-manager/release-notes.xhtml
stateVersion = "25.11";

username = "agent-amd64";
Expand Down
4 changes: 2 additions & 2 deletions ssh/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Include tailnet
Host sandbox-amd64
User agent-amd64

Host sandbox-arm64
User agent-arm64
Host ubuntu
User ubuntu

Host tahoe-vanilla
User admin
File renamed without changes.
12 changes: 12 additions & 0 deletions ubuntu/home-manager/home.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ ... }:
{
home = {
# https://nix-community.github.io/home-manager/release-notes.xhtml
stateVersion = "26.05";

username = "admin";
homeDirectory = "/home/admin";
};

programs.bash.enable = true; # Necessary for aliases and Starship to work.
}