Merge pull request 'clan.deployment: unify deprecated options' (#4184) from cli-fix into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4184
This commit is contained in:
@@ -51,7 +51,6 @@
|
|||||||
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript
|
||||||
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript.drvPath
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript.drvPath
|
||||||
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.clan.deployment.file
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.clan.deployment.file
|
||||||
|
|
||||||
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
|
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
|
||||||
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
|
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -304,14 +304,14 @@ clan {
|
|||||||
### Excluding from Automatic Updates
|
### Excluding from Automatic Updates
|
||||||
|
|
||||||
To exclude machines from being updated when running `clan machines update` without any machines specified,
|
To exclude machines from being updated when running `clan machines update` without any machines specified,
|
||||||
one can set the `clan.deployment.requireExplicitUpdate` option to true:
|
one can set the `clan.core.deployment.requireExplicitUpdate` option to true:
|
||||||
|
|
||||||
```{.nix hl_lines="5" .no-copy}
|
```{.nix hl_lines="5" .no-copy}
|
||||||
clan {
|
clan {
|
||||||
# ...
|
# ...
|
||||||
machines = {
|
machines = {
|
||||||
"jon" = {
|
"jon" = {
|
||||||
clan.deployment.requireExplicitUpdate = true;
|
clan.core.deployment.requireExplicitUpdate = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,31 +84,16 @@
|
|||||||
use = lib.trace "Obsolete option `${lib.showOption from}' is used. It was renamed to `${lib.showOption to}'.";
|
use = lib.trace "Obsolete option `${lib.showOption from}' is used. It was renamed to `${lib.showOption to}'.";
|
||||||
withPriority = false;
|
withPriority = false;
|
||||||
})
|
})
|
||||||
(lib.mkRenamedOptionModule
|
(lib.mkRemovedOptionModule [
|
||||||
[
|
"clan"
|
||||||
"clan"
|
"deployment"
|
||||||
"deployment"
|
] "Use clan.core.deployment instead")
|
||||||
]
|
(lib.mkRemovedOptionModule [
|
||||||
[
|
"clan"
|
||||||
"clan"
|
"core"
|
||||||
"core"
|
"networking"
|
||||||
"deployment"
|
"deploymentAddress"
|
||||||
]
|
] "Use clan.core.network.targetHost instead")
|
||||||
)
|
|
||||||
(lib.mkRenamedOptionModule
|
|
||||||
[
|
|
||||||
"clan"
|
|
||||||
"core"
|
|
||||||
"networking"
|
|
||||||
"deploymentAddress"
|
|
||||||
]
|
|
||||||
[
|
|
||||||
"clan"
|
|
||||||
"core"
|
|
||||||
"networking"
|
|
||||||
"targetHost"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
config = lib.optionalAttrs (_class == "nixos") (
|
config = lib.optionalAttrs (_class == "nixos") (
|
||||||
lib.mkIf config.clan.core.enableRecommendedDefaults {
|
lib.mkIf config.clan.core.enableRecommendedDefaults {
|
||||||
|
|||||||
@@ -80,8 +80,8 @@
|
|||||||
};
|
};
|
||||||
sops.defaultGroups = config.clan.core.sops.defaultGroups;
|
sops.defaultGroups = config.clan.core.sops.defaultGroups;
|
||||||
inherit (config.clan.core.networking) targetHost buildHost;
|
inherit (config.clan.core.networking) targetHost buildHost;
|
||||||
|
inherit (config.clan.core.deployment) requireExplicitUpdate;
|
||||||
inherit (config.system.clan.deployment) nixosMobileWorkaround;
|
inherit (config.system.clan.deployment) nixosMobileWorkaround;
|
||||||
inherit (config.clan.deployment) requireExplicitUpdate;
|
|
||||||
};
|
};
|
||||||
system.clan.deployment.file = pkgs.writeText "deployment.json" (
|
system.clan.deployment.file = pkgs.writeText "deployment.json" (
|
||||||
builtins.toJSON config.system.clan.deployment.data
|
builtins.toJSON config.system.clan.deployment.data
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Examples:
|
|||||||
$ clan machines update [MACHINES]
|
$ clan machines update [MACHINES]
|
||||||
Will update the specified machines [MACHINES], if [MACHINES] is omitted, the command
|
Will update the specified machines [MACHINES], if [MACHINES] is omitted, the command
|
||||||
will attempt to update every configured machine.
|
will attempt to update every configured machine.
|
||||||
To exclude machines being updated `clan.deployment.requireExplicitUpdate = true;`
|
To exclude machines being updated `clan.core.deployment.requireExplicitUpdate = true;`
|
||||||
can be set in the machine config.
|
can be set in the machine config.
|
||||||
|
|
||||||
$ clan machines update --tags [TAGS..]
|
$ clan machines update --tags [TAGS..]
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from clan_lib.api import API
|
|||||||
from clan_lib.api.disk import MachineDiskMatter
|
from clan_lib.api.disk import MachineDiskMatter
|
||||||
from clan_lib.api.modules import parse_frontmatter
|
from clan_lib.api.modules import parse_frontmatter
|
||||||
from clan_lib.dirs import specific_machine_dir
|
from clan_lib.dirs import specific_machine_dir
|
||||||
from clan_lib.errors import ClanError
|
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
from clan_lib.machines.actions import get_machine, list_machines
|
from clan_lib.machines.actions import get_machine, list_machines
|
||||||
from clan_lib.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
@@ -25,13 +24,7 @@ def list_full_machines(flake: Flake) -> dict[str, Machine]:
|
|||||||
|
|
||||||
res: dict[str, Machine] = {}
|
res: dict[str, Machine] = {}
|
||||||
|
|
||||||
for inv_machine in machines.values():
|
for name in machines:
|
||||||
name = inv_machine.get("name")
|
|
||||||
# Technically, this should not happen, but we are defensive here.
|
|
||||||
if name is None:
|
|
||||||
msg = "InternalError: Machine name is required. But got a machine without a name."
|
|
||||||
raise ClanError(msg)
|
|
||||||
|
|
||||||
machine = Machine(name=name, flake=flake)
|
machine = Machine(name=name, flake=flake)
|
||||||
res[machine.name] = machine
|
res[machine.name] = machine
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user