diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index 681c7f3a1..42411857d 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -82,16 +82,14 @@ let # Settings clan.core.settings = { inherit directory; + inherit (config.inventory.meta) name icon; machine = { inherit name; }; }; - # clan.core.settings.directory = directory; # Inherited from clan wide settings # TODO: remove these - clan.core.name = config.inventory.meta.name; - clan.core.icon = config.inventory.meta.icon; # Machine specific settings # clan.core.settings.machine.name = name; diff --git a/nixosModules/clanCore/metadata.nix b/nixosModules/clanCore/metadata.nix index 28b8417d7..01df49928 100644 --- a/nixosModules/clanCore/metadata.nix +++ b/nixosModules/clanCore/metadata.nix @@ -8,12 +8,12 @@ in "clan" "core" "clanName" - ] "clanName has been removed. Use clan.core.name instead.") + ] "clanName has been removed. Use clan.core.settings.name instead.") (lib.mkRemovedOptionModule [ "clan" "core" "clanIcon" - ] "clanIcon has been removed. Use clan.core.icon instead.") + ] "clanIcon has been removed. Use clan.core.settings.icon instead.") # The following options have been moved into clan.core.settings (lib.mkRenamedOptionModule @@ -25,6 +25,24 @@ in "directory" ] ) + (lib.mkRenamedOptionModule + [ "clan" "core" "name" ] + [ + "clan" + "core" + "settings" + "name" + ] + ) + (lib.mkRenamedOptionModule + [ "clan" "core" "icon" ] + [ + "clan" + "core" + "settings" + "icon" + ] + ) # The following options have been moved into clan.core.settings.machine (lib.mkRenamedOptionModule [ "clan" "core" "machineName" ] @@ -52,13 +70,29 @@ in the location of the flake repo, used to calculate the location of facts and secrets ''; }; + name = lib.mkOption { + type = lib.types.str; + description = '' + the name of the clan + ''; + # Set by the flake, so it's read-only in the maschine + readOnly = true; + }; + icon = lib.mkOption { + type = lib.types.nullOr lib.types.path; + description = '' + the location of the clan icon + ''; + # Set by the flake, so it's read-only in the maschine + readOnly = true; + }; machine = mkOption { description = '' Settings of the machine. This is a read-only attribute-set available to the machines of the clan. ''; - default = {}; + default = { }; type = types.submodule { options = { name = mkOption { @@ -75,22 +109,6 @@ in }; }; - name = lib.mkOption { - type = lib.types.str; - description = '' - the name of the clan - ''; - # Set by the flake, so it's read-only in the maschine - readOnly = true; - }; - icon = lib.mkOption { - type = lib.types.nullOr lib.types.path; - description = '' - the location of the clan icon - ''; - # Set by the flake, so it's read-only in the maschine - readOnly = true; - }; machineIcon = lib.mkOption { type = lib.types.nullOr lib.types.path; default = null; diff --git a/nixosModules/clanCore/vm.nix b/nixosModules/clanCore/vm.nix index ed03ee6eb..2ad5b1045 100644 --- a/nixosModules/clanCore/vm.nix +++ b/nixosModules/clanCore/vm.nix @@ -250,8 +250,8 @@ in config = { # for clan vm inspect clan.core.vm.inspect = { - clan_name = config.clan.core.name; - machine_icon = config.clan.core.machineIcon or config.clan.core.icon; + clan_name = config.clan.core.settings.name; + machine_icon = config.clan.core.machineIcon or config.clan.core.settings.icon; machine_name = config.clan.core.settings.machine.name; machine_description = config.clan.core.machineDescription; memory_size = config.clan.virtualisation.memorySize; diff --git a/nixosModules/clanCore/zerotier/default.nix b/nixosModules/clanCore/zerotier/default.nix index f7e6cb29f..25797db0c 100644 --- a/nixosModules/clanCore/zerotier/default.nix +++ b/nixosModules/clanCore/zerotier/default.nix @@ -23,7 +23,7 @@ in }; name = lib.mkOption { type = lib.types.str; - default = config.clan.core.name; + default = config.clan.core.settings.name; defaultText = "config.clan.core.name"; description = '' zerotier network name