configuration.nix

2.0 KB · raw

1# Golden NixOS dev image for nina testing — the reproducible "exact starting2# snapshot". Built once into a qcow2 (see build-golden.sh); Kiln boots a fresh3# throwaway overlay from it per run.4#5# Mirrors the test environment from the Kiln brief (§2.3): NixOS 24.11,6# test-primary host, git/curl/vim/htop/ripgrep, America/New_York.7{ config, pkgs, ... }:89{10  imports = [ ./hardware-configuration.nix ];1112  # BIOS GRUB on the virtio disk — avoids needing UEFI/OVMF firmware under qemu.13  boot.loader.grub = {14    enable = true;15    device = "/dev/vda";16  };17  # Serial console so the installed image is drivable headless (qemu -nographic).18  # Keep a normal vga console too.19  boot.kernelParams = [ "console=ttyS0,115200" "console=tty0" ];2021  networking.hostName = "test-primary";22  networking.useDHCP = true;23  time.timeZone = "America/New_York";2425  environment.systemPackages = with pkgs; [26    git27    curl28    vim29    htop30    ripgrep31  ];3233  # Headless driving: autologin root on the serial console so the build/boot34  # harness can run commands without credentials.35  services.getty.autologinUser = "root";3637  services.openssh = {38    enable = true;39    settings.PermitRootLogin = "yes";40    settings.PasswordAuthentication = true;41  };4243  # Test VM only — known password, never a real secret.44  users.users.root.password = "nixos";4546  # nina's config (brief §2.2). Written on activation so it stays in this file47  # rather than as imperative state. confirm=false auto-accepts; teach=true48  # echoes the underlying command; color=true enables ANSI the checks verify.49  system.activationScripts.ninaConf.text = ''50    cat > /root/.nina.conf <<'EOF'51    editor      = vim52    generations = 553    confirm     = false54    teach       = true55    color       = true5657    [machine]58    name    = test-primary59    config  = /etc/nixos60    local   = true61    default = true6263    [machine]64    name    = test-remote65    host    = 192.168.100.266    user    = testuser67    ssh_key = /home/testuser/.ssh/test_key68    EOF69  '';7071  system.stateVersion = "24.11";72}