clan-core/checks/lib/container-test.nix

35 lines
883 B
Nix
Raw Normal View History

2023-10-14 13:54:56 +00:00
test:
2024-03-17 18:48:49 +00:00
{ pkgs, self, ... }:
2023-10-14 13:54:56 +00:00
let
inherit (pkgs) lib;
nixos-lib = import (pkgs.path + "/nixos/lib") { };
in
2024-03-17 18:48:49 +00:00
(nixos-lib.runTest (
{ hostPkgs, ... }:
{
hostPkgs = pkgs;
# speed-up evaluation
defaults = {
nix.package = pkgs.nixVersions.latest;
2024-03-17 18:48:49 +00:00
documentation.enable = lib.mkDefault false;
boot.isContainer = true;
2023-10-14 13:54:56 +00:00
2024-03-17 18:48:49 +00:00
# undo qemu stuff
system.build.initialRamdisk = "";
virtualisation.sharedDirectories = lib.mkForce { };
networking.useDHCP = false;
2023-10-14 13:54:56 +00:00
2024-03-17 18:48:49 +00:00
# we have not private networking so far
networking.interfaces = lib.mkForce { };
#networking.primaryIPAddress = lib.mkForce null;
systemd.services.backdoor.enable = false;
};
# to accept external dependencies such as disko
node.specialArgs.self = self;
imports = [
test
./container-driver/module.nix
];
}
)).config.result