feat: disko OS-disk layout + nixos-anywhere install flow

- add disko input; jupiter partitions/formats OS disk declaratively
- hardware-configuration.nix carries kernel modules only (disko owns fileSystems)
- data disk stays a plain unformatted mount, out of disko
- vbox unchanged (virtualbox-image supplies its own disk)
- README: nixos-anywhere remote install + daily rebuild loop

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
erik
2026-07-12 17:44:05 +02:00
co-authored by Claude Opus 4.8
parent 27e9aaf787
commit 9fb32fd454
6 changed files with 147 additions and 49 deletions
+10 -1
View File
@@ -1,9 +1,10 @@
{ config, pkgs, lib, ... }:
# Real-host config: hardware + bootloader + shared services.
# Real-host config: hardware + disk layout + bootloader + shared services.
{
imports = [
./hardware-configuration.nix
./disk-config.nix # disko: OS-disk partitions + filesystems
./services.nix
];
@@ -11,4 +12,12 @@
# systemd-boot for UEFI. If ZimaBlade boots legacy/BIOS, switch to grub.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# ---- NAS data disk ----
# Existing data filesystem — mounted, NOT formatted (kept out of disko).
# Set the id from `ls -l /dev/disk/by-id` (or by-uuid). Adjust fsType.
# fileSystems."/mnt/data" = {
# device = "/dev/disk/by-id/CHANGE-ME-data-disk";
# fsType = "ext4";
# };
}
+42
View File
@@ -0,0 +1,42 @@
{ ... }:
# Declarative OS-disk layout (disko). UEFI: GPT with an ESP + ext4 root.
# disko both PARTITIONS/FORMATS this disk and generates the NixOS
# `fileSystems.*` entries, so hardware-configuration.nix must NOT define
# fileSystems for "/" or "/boot".
#
# ⚠️ This disk is WIPED on install. Set `device` to the OS disk ONLY.
# Your NAS data disk is NOT listed here — keep it out of disko so it is
# never formatted; mount it as a plain read-write fileSystem instead
# (see configuration.nix, /mnt/data).
#
# Find the stable id: ls -l /dev/disk/by-id (use by-id, never /dev/sdX)
{
disko.devices.disk.os = {
type = "disk";
device = "/dev/disk/by-id/CHANGE-ME-os-disk";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
}
+9 -24
View File
@@ -1,14 +1,13 @@
# PLACEHOLDER — do not use as-is.
# PLACEHOLDER — replace on the real machine.
#
# Generate the real file ON the ZimaBlade after booting the NixOS installer:
# disko (disk-config.nix) owns the OS-disk filesystems, so this file should
# only carry kernel modules + platform. Get the real values from the target:
#
# sudo nixos-generate-config --root /mnt
# # during install, or via nixos-anywhere --generate-hardware-config:
# sudo nixos-generate-config --no-filesystems --root /mnt
#
# then copy /mnt/etc/nixos/hardware-configuration.nix over this file.
# It contains machine-specific disk UUIDs, filesystems, and kernel modules.
#
# The block below is a minimal example so `nix flake check` does not fail on a
# workstation. REPLACE it entirely with the generated output.
# `--no-filesystems` omits the fileSystems.* blocks (disko provides them).
# Copy the generated file over this one. Keep the imports/kernel-module lines.
{ config, lib, pkgs, modulesPath, ... }:
{
@@ -19,22 +18,8 @@
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# Example root — replace UUID with real value from generated config.
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
# Example NAS data mount. Point at your storage disk/pool.
# fileSystems."/mnt/data" = {
# device = "/dev/disk/by-label/data";
# fsType = "ext4";
# };
# NO fileSystems here — disko defines "/" and "/boot" (see disk-config.nix).
# The NAS data mount lives in configuration.nix.
swapDevices = [ ];