tests: refactor
This commit is contained in:
parent
8a6bd41baa
commit
d7a0cbefe5
12 changed files with 184 additions and 127 deletions
|
|
@ -1,48 +1,9 @@
|
|||
{ pkgs, lib, config, modulesPath, ... }:
|
||||
let
|
||||
name = config.networking.hostName;
|
||||
moduleList = import (modulesPath + "/module-list.nix");
|
||||
|
||||
dynixFromSearchPath = let
|
||||
res = builtins.tryEval <dynix>;
|
||||
in lib.optional res.success res.value;
|
||||
in
|
||||
{
|
||||
imports = moduleList ++ [
|
||||
"${modulesPath}/testing/test-instrumentation.nix"
|
||||
./hardware-configuration.nix
|
||||
] ++ lib.concatLists [
|
||||
dynixFromSearchPath
|
||||
];
|
||||
|
||||
system.switch.enable = true;
|
||||
documentation.enable = false;
|
||||
|
||||
networking.hostName = "gotosocial-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;
|
||||
};
|
||||
};
|
||||
|
||||
services.gotosocial = {
|
||||
enable = true;
|
||||
setupPostgresqlDB = true;
|
||||
|
|
@ -53,19 +14,4 @@ in
|
|||
};
|
||||
|
||||
dynamicism.for.gotosocial.enable = 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
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,12 +52,6 @@ def get_config_file() -> str:
|
|||
machine.wait_for_unit("default.target")
|
||||
assert "lix" in machine.succeed("nix --version").lower()
|
||||
machine.log("INIT")
|
||||
run_log(machine, "journalctl --no-pager -eu install-dynix.service")
|
||||
|
||||
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.log("REBUILDING configuration inside VM")
|
||||
machine.succeed("env PAGER= nixos-rebuild switch --log-format raw-with-logs --fallback")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }:
|
||||
{ mkDynixConfigurationDotNix, config, ... }:
|
||||
|
||||
{
|
||||
name = "nixos-test-dynamicism-gotosocial";
|
||||
|
|
@ -17,7 +17,10 @@
|
|||
imports = [ ./configuration.nix ];
|
||||
|
||||
environment.systemPackages = let
|
||||
configFileTree = pkgs.callPackage ./configuration-package.nix { };
|
||||
configFileTree = mkDynixConfigurationDotNix {
|
||||
inherit (config) name;
|
||||
configuration = ./configuration.nix;
|
||||
};
|
||||
in [
|
||||
configFileTree
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue