mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
Update the installer tests for nixos-generate-config
This commit is contained in:
parent
3e001244e4
commit
647b0f5f5c
@ -37,13 +37,12 @@ let
|
||||
# The config to install
|
||||
config = builtins.toFile "configuration.nix" ''
|
||||
{ pkgs, ... }: {
|
||||
imports = [ ./hardware.nix <nixos/modules/testing/test-instrumentation.nix> ];
|
||||
imports = [ ./hardware-configuration.nix <nixos/modules/testing/test-instrumentation.nix> ];
|
||||
boot.kernelPackages = pkgs.linuxPackages_3_10;
|
||||
boot.loader.grub.enable = false;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.gummiboot.enable = true;
|
||||
fonts.enableFontConfig = false;
|
||||
fileSystems."/".label = "nixos";
|
||||
}
|
||||
'';
|
||||
|
||||
@ -84,12 +83,10 @@ in {
|
||||
|
||||
# Create the NixOS configuration.
|
||||
$machine->succeed(
|
||||
"mkdir -p /mnt/etc/nixos",
|
||||
"nixos-hardware-scan > /mnt/etc/nixos/hardware.nix",
|
||||
"nixos-generate-config --root /mnt",
|
||||
);
|
||||
|
||||
my $cfg = $machine->succeed("cat /mnt/etc/nixos/hardware.nix");
|
||||
print STDERR "Result of the hardware scan:\n$cfg\n";
|
||||
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
||||
|
||||
$machine->copyFileFromHost(
|
||||
"${config}",
|
||||
|
@ -38,7 +38,7 @@ let
|
||||
{ config, pkgs, modulesPath, ... }:
|
||||
|
||||
{ imports =
|
||||
[ ./hardware.nix
|
||||
[ ./hardware-configuration.nix
|
||||
"''${modulesPath}/testing/test-instrumentation.nix"
|
||||
];
|
||||
|
||||
@ -48,10 +48,7 @@ let
|
||||
''}
|
||||
boot.loader.grub.device = "${grubDevice}";
|
||||
boot.loader.grub.extraConfig = "serial; terminal_output.serial";
|
||||
boot.initrd.kernelModules = [ "ext3" "ext4" "xfs" "virtio_console" ];
|
||||
|
||||
${fileSystems}
|
||||
swapDevices = [ { label = "swap"; } ];
|
||||
boot.initrd.kernelModules = [ "virtio_console" ];
|
||||
|
||||
environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ];
|
||||
}
|
||||
@ -143,12 +140,10 @@ let
|
||||
|
||||
# Create the NixOS configuration.
|
||||
$machine->succeed(
|
||||
"mkdir -p /mnt/etc/nixos",
|
||||
"nixos-hardware-scan > /mnt/etc/nixos/hardware.nix",
|
||||
"nixos-generate-config --root /mnt",
|
||||
);
|
||||
|
||||
my $cfg = $machine->succeed("cat /mnt/etc/nixos/hardware.nix");
|
||||
print STDERR "Result of the hardware scan:\n$cfg\n";
|
||||
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
||||
|
||||
$machine->copyFileFromHost(
|
||||
"${ config { inherit fileSystems testChannel grubVersion grubDevice; } }",
|
||||
|
Loading…
Reference in New Issue
Block a user