Nix flake reproducing MacBook software capabilities for x86_64 NixOS laptops
Find a file
agent-engineering 060194b734 install.sh: fix swap creation and partition-range bugs
Review of branch t490-dualboot (laptop-config#1) found three correctness
issues in the new install.sh. This commit fixes them:

1. parted mkpart range used '-NIXOS_SIZE 100%' which on a T490 with a
   recovery partition at the end of the disk would overlap that
   recovery partition and fail. The new code computes the start of the
   freed space as the new end of the (now shrunken) Windows partition
   and uses explicit MiB offsets, so the new partition lands in the
   space ntfsresize actually freed.

2. SWAP_SIZE was advertised in the user-facing plan (lines 100-106 of
   the original) but no swap partition was ever created and swapon was
   never run. The new code creates a linux-swap partition after the
   NixOS root, runs mkswap, and swapon. The total shrink applied to
   the Windows partition is now nixos_bytes + swap_bytes.

3. The 'sort | tail -1' trick for finding the new partition breaks
   when more than one new partition is created (NixOS root + swap
   would both qualify) and is fragile for disks with 10+ existing
   partitions. The new code snapshots the partition list before mkpart
   and uses comm -13 to diff, then picks the lowest-numbered new
   partition for the NixOS root and the next one for swap.

Reported-by: agent-engineering review of sscoble/laptop-config#1
2026-06-06 05:48:45 -07:00
.forgejo/workflows Initial: Nix flake reproducing MacBook capabilities on x86_64 NixOS 2026-05-12 20:13:50 -07:00
docs Add T490 hardware configuration and docs 2026-05-14 17:40:04 -07:00
home pi: set default model to minimax-m3:cloud on ollama-cloud 2026-06-04 18:29:30 -07:00
modules T490 + Windows 11 dual-boot support 2026-06-05 19:53:56 -07:00
pkgs add obs, etc 2026-05-21 11:07:40 -07:00
wallpapers Add wallpaper rotation (4 wallpapers), fuzzel launcher, fix SSH/laptop.nix syntax 2026-05-16 23:49:24 -07:00
cheatsheet.pdf B&W cheatsheet for laser printer 2026-05-17 09:40:27 -07:00
cheatsheet.typ B&W cheatsheet for laser printer 2026-05-17 09:40:27 -07:00
flake.lock WGU prep: Windows VM setup, trackpad/trackpoint tweaks, aliases 2026-06-04 11:44:32 -07:00
flake.nix WGU prep: Windows VM setup, trackpad/trackpoint tweaks, aliases 2026-06-04 11:44:32 -07:00
hardware-configuration.nix Fix: SDDM DM, SSH server, cleanup pi 2026-05-16 16:04:16 -07:00
install.sh install.sh: fix swap creation and partition-range bugs 2026-06-06 05:48:45 -07:00
MIGRATION.md T490 + Windows 11 dual-boot support 2026-06-05 19:53:56 -07:00
pi-overlay.nix add obs, etc 2026-05-21 11:07:40 -07:00
README.md Add T490 hardware configuration and docs 2026-05-14 17:40:04 -07:00

Scobleclaw Laptop Config

Nix flake that reproduces MacBook software capabilities on an x86_64 NixOS laptop.

What it installs

Core tools

Tool Purpose Source
pi Coding agent (TUI) sscoble/pi-mono (Forgejo mirror of badlogic/pi-mono)
qmd Vault search @tobilu/qmd (npm, wrapped via bunx)
git Version control nixpkgs
nodejs JavaScript runtime nixpkgs
bun Fast JS runtime + bundler nixpkgs
zsh Shell (+ oh-my-zsh, autosuggestions, syntax highlighting) nixpkgs
neovim Editor (minimal Lua config) nixpkgs
python3 + uv Python tooling nixpkgs
go Go toolchain nixpkgs
docker Containers nixpkgs
tailscale Mesh VPN nixpkgs
ripgrep, fd, jq, bat, eza, delta Modern CLI tools nixpkgs

Desktop (Hyprland)

Tool Purpose
Hyprland Tiling Wayland compositor (gaps, blur, animations)
waybar Status bar with workspaces, clock, CPU, battery, network, audio
ghostty Fast native Wayland terminal emulator
zellij Terminal multiplexer (cmux equivalent — tabs, panes, floating)
rofi-wayland App launcher (SUPER + D)
dunst Notification daemon
swww Animated wallpaper
hyprlock Lock screen (SUPER + L, auto-lock 5min idle)
hypridle Idle daemon (lock + display sleep)
thunar File manager (SUPER + N)
grim + slurp + swappy Screenshots (SUPER + S = area, SUPER + Shift + S = full)
cliphist Clipboard history (SUPER + V → rofi picker)
brightnessctl + pavucontrol Brightness and audio control

Workspaces

# Name Icon Purpose
1 shell 󰆍 Terminal
2 code 󰨞 Development (editors, git)
3 web 󰖟 Browser
4 chat 󰭻 Communication (Discord, etc.)
5 vault 󰠮 Knowledge / vault
6 media 󰎆 Media player
7-9 7-9 — Spare
10 sys 󰒓 System settings

Keybindings

Key Action
SUPER + Return Open terminal with multiplexer (ghostty -e zellij)
SUPER + Shift + Return Open plain terminal (ghostty)
SUPER + D / SUPER + Space App launcher (rofi)
SUPER + B Firefox
SUPER + N File manager (thunar)
SUPER + Q Close window
SUPER + F Fullscreen
SUPER + G Toggle floating window
SUPER + L Lock screen
SUPER + V Clipboard history
SUPER + 1-0 Switch to workspace 1-10
SUPER + Shift + 1-0 Move window to workspace 1-10
SUPER + H/J/K/L Move focus (left/down/up/right)
SUPER + Shift + H/J/K/L Move window
SUPER + Ctrl + H/J/K/L Resize window
SUPER + S Screenshot area (→ swappy annotate)
SUPER + Shift + S Screenshot full screen
SUPER + Shift + Q Exit Hyprland
SUPER + Shift + R Reload Hyprland config

Zellij (terminal multiplexer)

Key Action
Ctrl + G Enter command mode
Ctrl + P Split pane down
Ctrl + N Split pane right
Ctrl + T New tab
Ctrl + H/J/K/L Move focus
Ctrl + X Close pane
Ctrl + F Toggle floating pane
Ctrl + Z Zoom pane fullscreen
Ctrl + Q Close tab
Ctrl + D Detach session

First-time setup (new laptop)

# 1. Install NixOS (minimal ISO) — set up network during install

# 2. Rebuild directly from Forgejo (no local clone needed)
sudo nixos-rebuild switch --flake git+https://os.scoble.me/forgejo/sscoble/laptop-config.git#laptop

# 3. First build of pi will fail — copy npmDepsHash from error, paste into flake.nix
#    Then re-clone/push the fix, or override locally:
#    nix build git+https://os.scoble.me/forgejo/sscoble/laptop-config.git#pi-coding-agent

# 4. Rebuild again with correct hash
sudo nixos-rebuild switch --flake git+https://os.scoble.me/forgejo/sscoble/laptop-config.git#laptop

# 5. Restore personal configs from backup:
#    ~/.pi/agent/SYSTEM.md
#    ~/.pi/agent/models.json
#    ~/.pi/agent/mcp.json
#    ~/.pi/agent/settings.json
#    ~/.ssh/id_ed25519
#    ~/wallpapers/default.jpg

Updating pi

The pi-mono repo is mirrored from upstream and syncs every 24h.

# Force a mirror sync (on n97-mini)
ssh n97-mini 'sudo -u forgejo forgejo admin repo sync --config /var/lib/forgejo/custom/conf/app.ini sscoble/pi-mono'

Repo structure

laptop-config/
├── flake.nix                     # Two targets: nixosConfigurations.laptop + homeConfigurations.sscoble
├── modules/
│   ├── laptop.nix                # System packages, zsh, fonts, SSH
│   ├── hyprland.nix              # Hyprland WM, greetd, PipeWire, portals, bluetooth
│   ├── t490.nix                  # T490 hardware: TLP, throttled, S3 sleep, remote builders, fwupd
│   └── vm.nix                    # UTM aarch64 VM for testing
├── home/
│   ├── sscoble.nix               # Shared (macOS + NixOS): zsh, git, nvim, pi, direnv, SSH
│   ├── desktop.nix               # Linux-only: Hyprland, waybar, ghostty, zellij, themes
│   └── wgu.nix                   # WGU software: Zotero, Brave, Obsidian, VSCode, Typst, Bitwarden
├── docs/
│   ├── T490-HARDWARE.md          # WiFi, GPU, audio, fingerprint, sleep/resume guide
│   ├── T490-BATTERY.md           # TLP config, threshold strategy, real-world numbers
│   └── T490-OFFLOADING.md        # What runs local vs cluster, remote builder setup
└── README.md

Two targets, one config

# Personal NixOS laptop (full system + Hyprland desktop)
sudo nixos-rebuild switch --flake git+https://os.scoble.me/forgejo/sscoble/laptop-config.git#laptop

# Work Mac (home-manager standalone — dotfiles, tools, no desktop)
home-manager switch --flake git+https://os.scoble.me/forgejo/sscoble/laptop-config.git#sscoble

Same zsh, git, neovim, pi config, SSH config on both machines.

Repo Purpose
sscoble/pi-mono pi coding agent (mirror of badlogic/pi-mono)
sscoble/wgu WGU coursework monorepo — class templates, study strategy, OB1 integration
NixOS/nixos-hardware T490 hardware quirks module (imported via flake input)

Forgejo Actions

An action keeps pi up to date — when upstream badlogic/pi-mono releases a new tag, the Forgejo mirror picks it up automatically. A scheduled workflow in this repo checks for tag drift daily.