feat(deploy): add self-growing disk-image-batm3 target
batm3-installed existed as a nixosConfiguration but had no dd-able disk image (only the live ISO, which is tmpfs — no persistent state.db/.env). Mirrors the douro/sintra make-disk-image blocks, with one improvement: boot.growPartition + fileSystems."/".autoResize so the root partition and ext4 expand to fill the target drive on first boot. Flashing is dd-and-done — no manual parted/resize2fs — and the full drive is available to the nix store from day one (the #55 headroom lesson). Image-only override via extendModules: the running system's batm3-installed config (what auto-upgrade rebuilds against) is unchanged. Build: nix build .#disk-image-batm3 → result/nixos.img Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5b523a488a
commit
f70105e8ff
1 changed files with 28 additions and 0 deletions
28
flake.nix
28
flake.nix
|
|
@ -331,6 +331,34 @@
|
|||
diskSize = "auto";
|
||||
};
|
||||
|
||||
# BATM3 (OptiPlex 9030 AIO board-swap) installed image, dd-able to
|
||||
# its SATA drive. Unlike the douro/sintra images, this one grows
|
||||
# itself: growPartition expands the root partition to fill whatever
|
||||
# drive it lands on (16GB today) at first boot and autoResize
|
||||
# stretches the ext4 to match — no manual parted/resize2fs step
|
||||
# after flashing, and all the drive's headroom is available to the
|
||||
# nix store from day one (cf. #55). Image-only override: once
|
||||
# grown, subsequent nixos-rebuilds against plain batm3-installed
|
||||
# are unaffected.
|
||||
disk-image-batm3 =
|
||||
let
|
||||
cfg = self.nixosConfigurations.batm3-installed.extendModules {
|
||||
modules = [
|
||||
{
|
||||
boot.growPartition = true;
|
||||
fileSystems."/".autoResize = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
in
|
||||
import (nixpkgs + "/nixos/lib/make-disk-image.nix") {
|
||||
inherit pkgs lib;
|
||||
config = cfg.config;
|
||||
format = "raw";
|
||||
partitionTableType = "efi";
|
||||
diskSize = "auto";
|
||||
};
|
||||
|
||||
# USB-bootable Sintra image with DISTINCT partition labels
|
||||
# (nixos-usb / ESP-USB) so the stick can be booted on a Sintra whose
|
||||
# eMMC already holds a nixos/ESP-labelled install without a by-label
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue