clan-core/pkgs/clan-cli/tests/test_flake_with_core/flake.nix

54 lines
1.7 KiB
Nix
Raw Normal View History

2023-09-14 14:57:19 +00:00
{
2023-09-16 14:21:33 +00:00
# Use this path to our repo root e.g. for UI test
# inputs.clan-core.url = "../../../../.";
2023-09-14 14:57:19 +00:00
# this placeholder is replaced by the path to nixpkgs
inputs.clan-core.url = "__CLAN_CORE__";
2024-03-17 18:48:49 +00:00
outputs =
{ self, clan-core }:
2023-09-21 15:17:48 +00:00
let
clan = clan-core.lib.buildClan {
directory = self;
2023-10-23 20:31:12 +00:00
clanName = "test_flake_with_core";
2023-09-21 15:17:48 +00:00
machines = {
2024-03-17 18:48:49 +00:00
vm1 =
{ lib, ... }:
{
clan.networking.targetHost = "__CLAN_TARGET_ADDRESS__";
system.stateVersion = lib.version;
sops.age.keyFile = "__CLAN_SOPS_KEY_PATH__";
2024-06-17 10:42:28 +00:00
clan.core.secretsUploadDirectory = "__CLAN_SOPS_KEY_DIR__";
clan.core.sops.defaultGroups = [ "admins" ];
2024-03-17 18:48:49 +00:00
clan.virtualisation.graphics = false;
2024-03-17 18:48:49 +00:00
clan.networking.zerotier.controller.enable = true;
networking.useDHCP = false;
2023-09-27 09:14:44 +00:00
2024-03-17 18:48:49 +00:00
systemd.services.shutdown-after-boot = {
enable = true;
wantedBy = [ "multi-user.target" ];
after = [ "multi-user.target" ];
script = ''
#!/usr/bin/env bash
shutdown -h now
'';
};
};
vm2 =
{ lib, ... }:
{
clan.networking.targetHost = "__CLAN_TARGET_ADDRESS__";
system.stateVersion = lib.version;
sops.age.keyFile = "__CLAN_SOPS_KEY_PATH__";
2024-06-17 10:42:28 +00:00
clan.core.secretsUploadDirectory = "__CLAN_SOPS_KEY_DIR__";
2024-03-17 18:48:49 +00:00
clan.networking.zerotier.networkId = "82b44b162ec6c013";
2023-09-27 09:14:44 +00:00
};
2023-09-14 14:57:19 +00:00
};
};
2023-09-21 15:17:48 +00:00
in
{
inherit (clan) nixosConfigurations clanInternals;
2023-09-14 14:57:19 +00:00
};
}