Clan-core: Rename clanName within Machines

This commit is contained in:
Johannes Kirschbauer
2024-08-06 10:45:16 +02:00
parent 0cf066f01b
commit 742e0a71b5
9 changed files with 37 additions and 23 deletions

View File

@@ -1,11 +1,33 @@
{ lib, pkgs, ... }:
{
imports = [
(lib.mkRemovedOptionModule [
"clan"
"core"
"clanName"
] "clanName has been removed. Use clan.core.name instead.")
(lib.mkRemovedOptionModule [
"clan"
"core"
"clanIcon"
] "clanIcon has been removed. Use clan.core.icon instead.")
];
options.clan.core = {
clanName = lib.mkOption {
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;
@@ -28,12 +50,6 @@
the location of the flake repo, used to calculate the location of facts and secrets
'';
};
clanIcon = lib.mkOption {
type = lib.types.nullOr lib.types.path;
description = ''
the location of the clan icon
'';
};
machineName = lib.mkOption {
type = lib.types.str;
default = "nixos";

View File

@@ -249,8 +249,8 @@ in
config = {
# for clan vm inspect
clan.core.vm.inspect = {
clan_name = config.clan.core.clanName;
machine_icon = config.clan.core.machineIcon or config.clan.core.clanIcon;
clan_name = config.clan.core.name;
machine_icon = config.clan.core.machineIcon or config.clan.core.icon;
machine_name = config.clan.core.machineName;
machine_description = config.clan.core.machineDescription;
memory_size = config.clan.virtualisation.memorySize;

View File

@@ -23,8 +23,8 @@ in
};
name = lib.mkOption {
type = lib.types.str;
default = config.clan.core.clanName;
defaultText = "config.clan.core.clanName";
default = config.clan.core.name;
defaultText = "config.clan.core.name";
description = ''
zerotier network name
'';