Skip to content

Commit 3089c3f

Browse files
committed
nixos: add NixOS support as third bringup option with libvirt integration
This commit adds NixOS as a third bringup option alongside guestfs and SKIP_BRINGUP, providing a declarative and reproducible way to provision test VMs using NixOS's functional package management system with full libvirt integration. Libvirt Integration: - NixOS VMs are managed through libvirt system session for professional VM lifecycle - Uses standard libvirt networking with DHCP assignment (192.168.122.x range) - No port forwarding needed - direct SSH access to VM IP addresses - Standard virsh commands for VM management (start, shutdown, destroy, console) - Integrates with existing libvirt infrastructure and monitoring tools SSH Session Management: - SSH keys are dynamically generated based on directory location using format: ~/.ssh/kdevops-nixos-<directory>-<hash> - This ensures unique keys per kdevops instance, preventing conflicts between multiple deployments - SSH config entries are automatically managed during bringup - Direct connections to DHCP-assigned IPs (no port forwarding complexity) Path Compatibility: - NixOS uses different system paths than traditional Linux distributions - Python interpreter: /run/current-system/sw/bin/python3 (not /usr/bin/python3) - Bash shell: /run/current-system/sw/bin/bash (not /bin/bash) - Templates automatically detect and use correct paths for NixOS VM Management: - Professional VM lifecycle through libvirt system session - XML-based VM configuration with proper resource allocation - QCOW2 disk images with virtio drivers for performance - Automatic network configuration via libvirt's default network - Full integration with existing libvirt monitoring and management tools Workflow Support: The following workflows have initial NixOS support with only package dependency resolution, actual run time tests will be needed later: - fstests: Filesystem testing (XFS, Btrfs, EXT4) - blktests: Block layer testing (NVMe, SCSI, NBD) - selftests: Linux kernel selftests - mmtests: Memory management performance testing - sysbench: Database performance benchmarking - pynfs: NFS protocol testing - ltp: Linux Test Project - gitr: Git regression testing Key Features: - Declarative configuration through Nix expressions - Reproducible builds using Nix flakes - Automatic dependency resolution for workflows - Directory-based isolation for multiple kdevops instances - Full libvirt integration for professional VM management - Automatic SSH configuration during bringup - Standard networking without port forwarding complexity This implementation provides a modern, functional approach to VM provisioning that leverages both NixOS's strengths in reproducibility and libvirt's professional VM management capabilities. Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 3883a32 commit 3089c3f

30 files changed

+2294
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ scripts/kconfig/.nconf-cfg
102102
Kconfig.passthrough_libvirt.generated
103103

104104
archive/
105+
106+
# NixOS generated files
107+
nixos/generated/

defconfigs/nixos

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CONFIG_NIXOS=y
2+
CONFIG_LIBVIRT=y
3+
4+
# Disable mirror setup for NixOS
5+
CONFIG_ENABLE_LOCAL_LINUX_MIRROR=n
6+
CONFIG_USE_LOCAL_LINUX_MIRROR=n
7+
CONFIG_INSTALL_LOCAL_LINUX_MIRROR=n
8+
CONFIG_MIRROR_INSTALL=n
9+
10+
CONFIG_NIXOS_USE_FLAKES=y
11+
CONFIG_NIXOS_CHANNEL="nixos-unstable"
12+
CONFIG_NIXOS_ENABLE_WORKFLOW_DEPS=y
13+
CONFIG_NIXOS_LIBVIRT_SESSION_INFERENCE=y
14+
15+
CONFIG_NIXOS_VM_MEMORY_MB=4096
16+
CONFIG_NIXOS_VM_DISK_SIZE_GB=20
17+
CONFIG_NIXOS_VM_VCPUS=4
18+
19+
CONFIG_WORKFLOWS=y
20+
CONFIG_WORKFLOW_LINUX_CUSTOM=y
21+
22+
CONFIG_BOOTLINUX=y
23+
CONFIG_BOOTLINUX_9P=n
24+
25+
CONFIG_KDEVOPS_TRY_REFRESH_REPOS=y
26+
CONFIG_KDEVOPS_TRY_UPDATE_SYSTEMS=y
27+
CONFIG_KDEVOPS_TRY_INSTALL_KDEV_TOOLS=y

0 commit comments

Comments
 (0)