diff --git a/pkgs/clan-cli/clan_lib/tests/test_create.py b/pkgs/clan-cli/clan_lib/tests/test_create.py index b34ab4ac8..4e99a4bce 100644 --- a/pkgs/clan-cli/clan_lib/tests/test_create.py +++ b/pkgs/clan-cli/clan_lib/tests/test_create.py @@ -21,6 +21,7 @@ from clan_lib.dirs import specific_machine_dir from clan_lib.errors import ClanError from clan_lib.flake import ClanSelectError, Flake from clan_lib.machines.machines import Machine +from clan_lib.network.network import get_network_overview, networks_from_flake from clan_lib.nix import nix_command from clan_lib.nix_models.clan import ( InventoryInstancesType, @@ -272,6 +273,11 @@ def test_clan_create_api( set_machine_disk_schema(machine, "single-disk", placeholders) clan_dir_flake.invalidate_cache() + # ===== Test that clan network list works ====== + networks = networks_from_flake(clan_dir_flake) + overview = get_network_overview(networks) + assert overview is not None + # In the sandbox, building fails due to network restrictions (can't download dependencies) # Outside the sandbox, the build should succeed in_sandbox = os.environ.get("IN_NIX_SANDBOX") == "1" diff --git a/templates/clan/default/flake.nix b/templates/clan/default/flake.nix index 17582db0b..340c1b70e 100644 --- a/templates/clan/default/flake.nix +++ b/templates/clan/default/flake.nix @@ -19,6 +19,7 @@ in { inherit (clan.config) nixosConfigurations nixosModules clanInternals; + clan = clan.config; # Add the Clan cli tool to the dev shell. # Use "nix develop" to enter the dev shell. devShells = diff --git a/templates/clan/minimal/flake.nix b/templates/clan/minimal/flake.nix index 3762f5e3a..6ce796cf9 100644 --- a/templates/clan/minimal/flake.nix +++ b/templates/clan/minimal/flake.nix @@ -16,5 +16,6 @@ { # all machines managed by Clan inherit (clan.config) nixosConfigurations nixosModules clanInternals; + clan = clan.config; }; }