ALPHA: wire is a tool to deploy nixos systems
wire.althaea.zone/
1# SPDX-License-Identifier: AGPL-3.0-or-later
2# Copyright 2024-2025 wire Contributors
3
4{ testName }:
5let
6 # Use the flake-compat code in project root to access the tests which are
7 # defined through Flakes, as flake-parts is heavily depended on here.
8 flake = import ../../../.;
9in
10{
11 # This is glue for the newly deployed VMs as they need specific configuration
12 # such as static network configuration and other nitpicky VM-specific options.
13 # I thank Colmena & NixOps devs for providing me pointers on how to correctly create this, so
14 # thank you to those who made them!
15 #
16 mkHiveNode =
17 {
18 hostname,
19 system ? "x86_64-linux",
20 }:
21 cfg: {
22 imports = [
23 cfg
24 (
25 {
26 modulesPath,
27 pkgs,
28 ...
29 }:
30 let
31 snakeOil = import "${pkgs.path}/nixos/tests/ssh-keys.nix" pkgs;
32 in
33 {
34 imports = [
35 "${modulesPath}/virtualisation/qemu-vm.nix"
36 "${modulesPath}/testing/test-instrumentation.nix"
37 flake.checks.${system}."vm-${testName}".nodes.${hostname}.system.build.networkConfig
38 ];
39
40 nixpkgs.hostPlatform = system;
41 boot.loader.grub.enable = false;
42
43 services.openssh.enable = true;
44 users.users.root.openssh.authorizedKeys.keys = [ snakeOil.snakeOilEd25519PublicKey ];
45
46 environment.systemPackages = [ pkgs.ripgrep ];
47 }
48 )
49 ];
50 };
51
52 inherit (flake) makeHive;
53}