tests: refactor
This commit is contained in:
parent
8a6bd41baa
commit
d7a0cbefe5
12 changed files with 184 additions and 127 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, lib, config, modulesPath, ... }:
|
||||
{ lib, modulesPath, ... }:
|
||||
let
|
||||
moduleList = import "${modulesPath}/module-list.nix";
|
||||
|
||||
|
|
@ -8,10 +8,10 @@ let
|
|||
in
|
||||
{
|
||||
imports = [
|
||||
"${modulesPath}/testing/test-instrumentation.nix"
|
||||
./hardware-configuration.nix
|
||||
#"${modulesPath}/testing/test-instrumentation.nix"
|
||||
#./hardware-configuration.nix
|
||||
] ++ lib.concatLists [
|
||||
dynixFromSearchPath
|
||||
#dynixFromSearchPath
|
||||
moduleList
|
||||
];
|
||||
|
||||
|
|
@ -26,47 +26,5 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
system.switch.enable = true;
|
||||
documentation.enable = false;
|
||||
|
||||
networking.hostName = "harmonia-machine";
|
||||
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
device = "/dev/vda";
|
||||
forceInstall = true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = pkgs.lixPackageSets.latest.lix;
|
||||
nixPath = [
|
||||
"nixpkgs=${pkgs.path}"
|
||||
"/nix/var/nix/profiles/per-user/root/profile/share/nixos/modules"
|
||||
];
|
||||
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "pipe-operator" ];
|
||||
substituters = lib.mkForce [ ];
|
||||
hashed-mirrors = null;
|
||||
connect-timeout = 1;
|
||||
# For my debugging purposes.
|
||||
show-trace = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment.pathsToLink = [ "/share" ];
|
||||
environment.extraOutputsToInstall = [ "modules" ];
|
||||
environment.variables = {
|
||||
"NIXOS_CONFIG" = "/etc/nixos/configuration.nix";
|
||||
};
|
||||
|
||||
environment.shellAliases = {
|
||||
ls = "eza --long --header --group --group-directories-first --classify --binary";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
eza
|
||||
fd
|
||||
ripgrep
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,10 +66,6 @@ assert int(config_toml['workers']) == 4, f"{config_toml['workers']=} != 4"
|
|||
assert int(config_toml['max_connection_rate']) == 256, f"{config_toml['max_connection_rate']=} != 256"
|
||||
|
||||
with machine.nested("must succeed: initial nixos-rebuild switch"):
|
||||
machine.succeed("nixos-generate-config")
|
||||
machine.succeed("mkdir -vp /etc/nixos")
|
||||
# Dereference is required since that configuration.nix is probably a symlink to the store.
|
||||
machine.succeed("cp -rv --dereference /run/current-system/sw/share/nixos/configuration.nix /etc/nixos/")
|
||||
machine.succeed("env PAGER= nixos-rebuild switch --log-format raw-with-logs --fallback")
|
||||
|
||||
# Config should not have changed.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }:
|
||||
{ mkDynixConfigurationDotNix, config, ... }:
|
||||
{
|
||||
name = "nixos-test-dynamicism-harmonia";
|
||||
|
||||
|
|
@ -10,10 +10,14 @@
|
|||
imports = [ ./configuration.nix ];
|
||||
|
||||
environment.systemPackages = let
|
||||
configFileTree = pkgs.runCommand "${name}-configuration-dot-nix" { } ''
|
||||
set -euo pipefail
|
||||
install -Dm a=r ${./configuration.nix} "$out/share/nixos/configuration.nix"
|
||||
'';
|
||||
#configFileTree = pkgs.runCommand "${name}-configuration-dot-nix" { } ''
|
||||
# set -euo pipefail
|
||||
# install -Dm a=r ${./configuration.nix} "$out/share/nixos/configuration.nix"
|
||||
#'';
|
||||
configFileTree = mkDynixConfigurationDotNix {
|
||||
inherit (config) name;
|
||||
configuration = ./configuration.nix;
|
||||
};
|
||||
in [
|
||||
configFileTree
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue