2024-06-16 13:13:07 +03:00
|
|
|
{ lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
# FIXME (roberth) reference issue
|
|
|
|
inputDerivation = pkg: (pkg.overrideAttrs (o: {
|
|
|
|
disallowedReferences = [ ];
|
|
|
|
})).inputDerivation;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# We rarely change the script in a way that benefits from type checking, so
|
|
|
|
# we skip it to save time.
|
|
|
|
skipTypeCheck = true;
|
|
|
|
|
|
|
|
nodes.machine = { config, pkgs, ... }: {
|
|
|
|
|
|
|
|
virtualisation.writableStore = true;
|
|
|
|
system.extraDependencies = [
|
|
|
|
(inputDerivation config.nix.package)
|
|
|
|
];
|
|
|
|
|
|
|
|
nix.settings.substituters = lib.mkForce [];
|
|
|
|
|
|
|
|
environment.systemPackages = let
|
|
|
|
run-test-suite = pkgs.writeShellApplication {
|
|
|
|
name = "run-test-suite";
|
2024-11-04 00:10:34 +02:00
|
|
|
runtimeInputs = [
|
|
|
|
pkgs.meson
|
|
|
|
pkgs.ninja
|
|
|
|
pkgs.jq
|
|
|
|
pkgs.git
|
|
|
|
|
|
|
|
# Want to avoid `/run/current-system/sw/bin/bash` because we
|
|
|
|
# want a store path. Likewise for coreutils.
|
|
|
|
pkgs.bash
|
|
|
|
pkgs.coreutils
|
|
|
|
];
|
2024-06-16 13:13:07 +03:00
|
|
|
text = ''
|
|
|
|
set -x
|
2024-11-04 00:10:34 +02:00
|
|
|
|
2024-06-16 13:13:07 +03:00
|
|
|
cat /proc/sys/fs/file-max
|
|
|
|
ulimit -Hn
|
|
|
|
ulimit -Sn
|
2024-11-04 00:10:34 +02:00
|
|
|
|
2024-06-16 13:13:07 +03:00
|
|
|
cd ~
|
|
|
|
|
2024-11-04 00:10:34 +02:00
|
|
|
cp -r ${pkgs.nixComponents.nix-functional-tests.src} nix
|
|
|
|
chmod -R +w nix
|
2024-06-16 13:13:07 +03:00
|
|
|
|
2024-11-04 00:10:34 +02:00
|
|
|
chmod u+w nix/.version
|
|
|
|
echo ${pkgs.nixComponents.version} > nix/.version
|
2024-11-01 15:56:50 +02:00
|
|
|
|
2024-06-16 13:13:07 +03:00
|
|
|
export isTestOnNixOS=1
|
2024-11-04 00:10:34 +02:00
|
|
|
|
2024-06-16 13:13:07 +03:00
|
|
|
export NIX_REMOTE_=daemon
|
|
|
|
export NIX_REMOTE=daemon
|
2024-11-04 00:10:34 +02:00
|
|
|
|
2024-06-16 13:13:07 +03:00
|
|
|
export NIX_STORE=${builtins.storeDir}
|
2024-11-04 00:10:34 +02:00
|
|
|
|
|
|
|
meson setup nix/tests/functional build
|
|
|
|
cd build
|
|
|
|
meson test -j1 --print-errorlogs
|
2024-06-16 13:13:07 +03:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in [
|
|
|
|
run-test-suite
|
|
|
|
pkgs.git
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|