configuration.nix

2.4 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    nixpkgs-fmt # nina fmt32  ];3334  # nina search/diff/pkg use the new `nix` CLI (flakes). Pin the nixpkgs flake35  # registry to the local channel path so `nix search nixpkgs` resolves offline36  # instead of fetching github per disposable overlay.37  nix.settings.experimental-features = [ "nix-command" "flakes" ];38  nix.registry.nixpkgs.to = {39    type = "path";40    path = pkgs.path;41  };4243  # Headless driving: autologin root on the serial console so the build/boot44  # harness can run commands without credentials.45  services.getty.autologinUser = "root";4647  services.openssh = {48    enable = true;49    settings.PermitRootLogin = "yes";50    settings.PasswordAuthentication = true;51  };5253  # Test VM only — known password, never a real secret.54  users.users.root.password = "nixos";5556  # nina's config (brief §2.2). Written on activation so it stays in this file57  # rather than as imperative state. confirm=false auto-accepts; teach=true58  # echoes the underlying command; color=true enables ANSI the checks verify.59  system.activationScripts.ninaConf.text = ''60    cat > /root/.nina.conf <<'EOF'61    editor      = vim62    generations = 563    confirm     = false64    teach       = true65    color       = true6667    [machine]68    name    = test-primary69    config  = /etc/nixos70    local   = true71    default = true7273    [machine]74    name    = test-remote75    host    = 192.168.100.276    user    = testuser77    ssh_key = /home/testuser/.ssh/test_key78    EOF79  '';8081  system.stateVersion = "24.11";82}