From cd73e64235c9fb3972d22934841d17859cb4aa37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 17 Jun 2024 14:20:44 +0200 Subject: [PATCH] rename clanName -> meta.name --- docs/site/getting-started/configure.md | 6 +++--- docs/site/getting-started/flake-parts.md | 2 +- nixosModules/clanCore/vm.nix | 2 +- nixosModules/clanCore/zerotier/default.nix | 4 ++-- pkgs/clan-cli/clan_cli/clan/inspect.py | 2 +- pkgs/clan-cli/clan_cli/config/schema.py | 2 +- pkgs/clan-cli/tests/test_flake_with_core/flake.nix | 2 +- pkgs/clan-cli/tests/test_flake_with_core_and_pass/flake.nix | 2 +- .../tests/test_flake_with_core_dynamic_machines/flake.nix | 2 +- pkgs/schemas/flake-module.nix | 2 +- templates/new-clan/flake.nix | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/site/getting-started/configure.md b/docs/site/getting-started/configure.md index 8c3f0ab2..ad9a0929 100644 --- a/docs/site/getting-started/configure.md +++ b/docs/site/getting-started/configure.md @@ -4,14 +4,14 @@ In the `flake.nix` file: -- [x] set a unique `clanName`. +- [x] set a unique `meta.name`. === "**buildClan**" ```nix title="clan-core.lib.buildClan" buildClan { # Set a unique name - clanName = "Lobsters"; + meta.name = "Lobsters"; # Should usually point to the directory of flake.nix directory = ./.; @@ -31,7 +31,7 @@ In the `flake.nix` file: ```nix title="clan-core.flakeModules.default" clan = { # Set a unique name - clanName = "Lobsters"; + meta.name = "Lobsters"; machines = { jon = { diff --git a/docs/site/getting-started/flake-parts.md b/docs/site/getting-started/flake-parts.md index 1ed3d883..fc883629 100644 --- a/docs/site/getting-started/flake-parts.md +++ b/docs/site/getting-started/flake-parts.md @@ -63,7 +63,7 @@ Below is a guide on how to structure this in your flake.nix: # Define your clan clan = { # Clan wide settings. (Required) - clanName = ""; # Ensure to choose a unique name. + meta.name = ""; # Ensure to choose a unique name. machines = { jon = { diff --git a/nixosModules/clanCore/vm.nix b/nixosModules/clanCore/vm.nix index 83805b86..13efb614 100644 --- a/nixosModules/clanCore/vm.nix +++ b/nixosModules/clanCore/vm.nix @@ -229,7 +229,7 @@ in config = { # for clan vm inspect clanCore.vm.inspect = { - clan_name = config.clanCore.clanName; + clan_name = config.clanCore.meta.name; machine_icon = config.clanCore.machineIcon or config.clanCore.clanIcon; machine_name = config.clanCore.machineName; machine_description = config.clanCore.machineDescription; diff --git a/nixosModules/clanCore/zerotier/default.nix b/nixosModules/clanCore/zerotier/default.nix index c5796a90..09c6ac33 100644 --- a/nixosModules/clanCore/zerotier/default.nix +++ b/nixosModules/clanCore/zerotier/default.nix @@ -23,8 +23,8 @@ in }; name = lib.mkOption { type = lib.types.str; - default = config.clanCore.clanName; - defaultText = "config.clanCore.clanName"; + default = config.clanCore.meta.name; + defaultText = "config.clanCore.meta.name"; description = '' zerotier network name ''; diff --git a/pkgs/clan-cli/clan_cli/clan/inspect.py b/pkgs/clan-cli/clan_cli/clan/inspect.py index 906a6630..68dc6643 100644 --- a/pkgs/clan-cli/clan_cli/clan/inspect.py +++ b/pkgs/clan-cli/clan_cli/clan/inspect.py @@ -56,7 +56,7 @@ def inspect_flake(flake_url: str | Path, machine_name: str) -> FlakeConfig: # Get the Clan name cmd = nix_eval( [ - f'{flake_url}#clanInternals.machines."{system}"."{machine_name}".config.clanCore.clanName' + f'{flake_url}#clanInternals.machines."{system}"."{machine_name}".config.clanCore.meta.name' ] ) res = run_cmd(cmd) diff --git a/pkgs/clan-cli/clan_cli/config/schema.py b/pkgs/clan-cli/clan_cli/config/schema.py index b4fe71d7..c94580b8 100644 --- a/pkgs/clan-cli/clan_cli/config/schema.py +++ b/pkgs/clan-cli/clan_cli/config/schema.py @@ -84,7 +84,7 @@ def machine_schema( # potentially the config might affect submodule options, # therefore we need to import it config - {{ clanCore.clanName = "fakeClan"; }} + {{ clanCore.meta.name = "fakeClan"; }} ] # add all clan modules specified via clanImports ++ (map (name: clan-core.clanModules.${{name}}) config.clanImports or []); diff --git a/pkgs/clan-cli/tests/test_flake_with_core/flake.nix b/pkgs/clan-cli/tests/test_flake_with_core/flake.nix index 2b1f4d0e..6b01c5c0 100644 --- a/pkgs/clan-cli/tests/test_flake_with_core/flake.nix +++ b/pkgs/clan-cli/tests/test_flake_with_core/flake.nix @@ -10,7 +10,7 @@ let clan = clan-core.lib.buildClan { directory = self; - clanName = "test_flake_with_core"; + meta.name = "test_flake_with_core"; machines = { vm1 = { lib, ... }: diff --git a/pkgs/clan-cli/tests/test_flake_with_core_and_pass/flake.nix b/pkgs/clan-cli/tests/test_flake_with_core_and_pass/flake.nix index d9ca403b..f81ccf39 100644 --- a/pkgs/clan-cli/tests/test_flake_with_core_and_pass/flake.nix +++ b/pkgs/clan-cli/tests/test_flake_with_core_and_pass/flake.nix @@ -10,7 +10,7 @@ let clan = clan-core.lib.buildClan { directory = self; - clanName = "test_flake_with_core_and_pass"; + meta.name = "test_flake_with_core_and_pass"; machines = { vm1 = { lib, ... }: diff --git a/pkgs/clan-cli/tests/test_flake_with_core_dynamic_machines/flake.nix b/pkgs/clan-cli/tests/test_flake_with_core_dynamic_machines/flake.nix index e10e244d..1d27ca39 100644 --- a/pkgs/clan-cli/tests/test_flake_with_core_dynamic_machines/flake.nix +++ b/pkgs/clan-cli/tests/test_flake_with_core_dynamic_machines/flake.nix @@ -10,7 +10,7 @@ let clan = clan-core.lib.buildClan { directory = self; - clanName = "test_flake_with_core_dynamic_machines"; + meta.name = "test_flake_with_core_dynamic_machines"; machines = let machineModules = builtins.readDir (self + "/machines"); diff --git a/pkgs/schemas/flake-module.nix b/pkgs/schemas/flake-module.nix index a9a81426..1a96d537 100644 --- a/pkgs/schemas/flake-module.nix +++ b/pkgs/schemas/flake-module.nix @@ -14,7 +14,7 @@ imports = (import (pkgs.path + "/nixos/modules/module-list.nix")) ++ [ { nixpkgs.hostPlatform = "x86_64-linux"; - clanCore.clanName = "dummy"; + clanCore.meta.name = "dummy"; } ]; }; diff --git a/templates/new-clan/flake.nix b/templates/new-clan/flake.nix index 7fb1361e..273d3a2f 100644 --- a/templates/new-clan/flake.nix +++ b/templates/new-clan/flake.nix @@ -11,7 +11,7 @@ # Usage see: https://docs.clan.lol clan = clan-core.lib.buildClan { directory = self; - clanName = "__CHANGE_ME__"; # Ensure this is internet wide unique. + meta.name = "__CHANGE_ME__"; # Ensure this is internet wide unique. # Prerequisite: boot into the installer # See: https://docs.clan.lol/getting-started/installer