Chore: move 'icon','name' into 'clan.core.settings' submodule

This commit is contained in:
Johannes Kirschbauer
2024-12-31 15:17:52 +01:00
parent c9a005b8d9
commit 1c6716674a
4 changed files with 41 additions and 25 deletions

View File

@@ -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;

View File

@@ -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,6 +70,22 @@ 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.
@@ -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;

View File

@@ -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;

View File

@@ -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