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
|
# The config to install
|
||||||
config = builtins.toFile "configuration.nix" ''
|
config = builtins.toFile "configuration.nix" ''
|
||||||
{ pkgs, ... }: {
|
{ 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.kernelPackages = pkgs.linuxPackages_3_10;
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
boot.loader.gummiboot.enable = true;
|
boot.loader.gummiboot.enable = true;
|
||||||
fonts.enableFontConfig = false;
|
fonts.enableFontConfig = false;
|
||||||
fileSystems."/".label = "nixos";
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -84,12 +83,10 @@ in {
|
|||||||
|
|
||||||
# Create the NixOS configuration.
|
# Create the NixOS configuration.
|
||||||
$machine->succeed(
|
$machine->succeed(
|
||||||
"mkdir -p /mnt/etc/nixos",
|
"nixos-generate-config --root /mnt",
|
||||||
"nixos-hardware-scan > /mnt/etc/nixos/hardware.nix",
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my $cfg = $machine->succeed("cat /mnt/etc/nixos/hardware.nix");
|
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
||||||
print STDERR "Result of the hardware scan:\n$cfg\n";
|
|
||||||
|
|
||||||
$machine->copyFileFromHost(
|
$machine->copyFileFromHost(
|
||||||
"${config}",
|
"${config}",
|
||||||
|
@ -38,7 +38,7 @@ let
|
|||||||
{ config, pkgs, modulesPath, ... }:
|
{ config, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{ imports =
|
{ imports =
|
||||||
[ ./hardware.nix
|
[ ./hardware-configuration.nix
|
||||||
"''${modulesPath}/testing/test-instrumentation.nix"
|
"''${modulesPath}/testing/test-instrumentation.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -48,10 +48,7 @@ let
|
|||||||
''}
|
''}
|
||||||
boot.loader.grub.device = "${grubDevice}";
|
boot.loader.grub.device = "${grubDevice}";
|
||||||
boot.loader.grub.extraConfig = "serial; terminal_output.serial";
|
boot.loader.grub.extraConfig = "serial; terminal_output.serial";
|
||||||
boot.initrd.kernelModules = [ "ext3" "ext4" "xfs" "virtio_console" ];
|
boot.initrd.kernelModules = [ "virtio_console" ];
|
||||||
|
|
||||||
${fileSystems}
|
|
||||||
swapDevices = [ { label = "swap"; } ];
|
|
||||||
|
|
||||||
environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ];
|
environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ];
|
||||||
}
|
}
|
||||||
@ -143,12 +140,10 @@ let
|
|||||||
|
|
||||||
# Create the NixOS configuration.
|
# Create the NixOS configuration.
|
||||||
$machine->succeed(
|
$machine->succeed(
|
||||||
"mkdir -p /mnt/etc/nixos",
|
"nixos-generate-config --root /mnt",
|
||||||
"nixos-hardware-scan > /mnt/etc/nixos/hardware.nix",
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my $cfg = $machine->succeed("cat /mnt/etc/nixos/hardware.nix");
|
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
||||||
print STDERR "Result of the hardware scan:\n$cfg\n";
|
|
||||||
|
|
||||||
$machine->copyFileFromHost(
|
$machine->copyFileFromHost(
|
||||||
"${ config { inherit fileSystems testChannel grubVersion grubDevice; } }",
|
"${ config { inherit fileSystems testChannel grubVersion grubDevice; } }",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user