Add support for persistent disks in the hydra iso.

This commit is contained in:
Tom Alexander
2025-03-27 20:39:19 -04:00
parent 2b20ab5123
commit 83de1e3708
3 changed files with 105 additions and 5 deletions

View File

@@ -1,9 +1,31 @@
{ config, pkgs, ... }:
#
# Testing:
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
# -accel kvm \
# -cpu host \
# -smp cores=8 \
# -m 32768 \
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
# -drive file=/tmp/localdisk.img,if=none,id=nvm,format=raw \
# -device nvme,serial=deadbeef,drive=nvm \
# -nic user,hostfwd=tcp::60022-:22 \
# -boot order=d \
# -cdrom "$(readlink -f /persist/machine_setup/nix/configuration/result/iso/nixos*.iso)" \
# -display vnc=127.0.0.1:0
#
{
config,
lib,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
./disk-config.nix
./hardware-configuration.nix
./optimized_build.nix
./vm_disk.nix
];
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
@@ -21,9 +43,10 @@
me.emacs_flavor = "plainmacs";
me.graphical = false;
me.zsh.enable = true;
me.vm_disk.enable = true;
me.wireguard.activated = [ ];
me.wireguard.deactivated = [ ];
me.zsh.enable = true;
# Trust this key so nix running as root can ssh into hydra.
users.users.talexander.openssh.authorizedKeys.keys = [