Chore: move 'icon','name' into 'clan.core.settings' submodule
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user