rename hw-generate to update-hardware-config

This commit is contained in:
Jörg Thalheim
2024-09-20 13:39:53 +02:00
parent 8e1734345b
commit 8a8b473236
4 changed files with 10 additions and 10 deletions

View File

@@ -99,7 +99,7 @@
client.wait_until_succeeds("timeout 2 ssh -o StrictHostKeyChecking=accept-new -v root@target hostname")
client.succeed("cp -r ${../..} test-flake && chmod -R +w test-flake")
client.fail("test -f test-flake/machines/test-install-machine/hardware-configuration.nix")
client.succeed("clan machines hw-generate --flake test-flake test-install-machine root@target>&2")
client.succeed("clan machines update-hardware-config --flake test-flake test-install-machine root@target>&2")
client.succeed("test -f test-flake/machines/test-install-machine/hardware-configuration.nix")
client.succeed("clan machines install --debug --flake ${../..} --yes test-install-machine root@target >&2")
try:

View File

@@ -144,14 +144,14 @@ These steps will allow you to update your machine later.
Generate the `hardware-configuration.nix` file for your machine by executing the following command:
```bash
clan machines hw-generate [MACHINE_NAME]
clan machines update-hardware-config [MACHINE_NAME]
```
replace `[MACHINE_NAME]` with the name of the machine i.e. `jon` and `[HOSTNAME]` with the `ip_adress` or `hostname` of the machine within the network. i.e. `<IP>`
!!! Example
```bash
clan machines hw-generate jon
clan machines update-hardware-config jon
```
This command connects to the ip configured in the previous step, runs `nixos-generate-config` to detect hardware configurations (excluding filesystems), and writes them to `machines/jon/hardware-configuration.nix`.

View File

@@ -3,7 +3,7 @@ import argparse
from .create import register_create_parser
from .delete import register_delete_parser
from .hardware import register_hw_generate
from .hardware import register_update_hardware_config
from .import_cmd import register_import_parser
from .install import register_install_parser
from .list import register_list_parser
@@ -64,8 +64,8 @@ Examples:
)
register_list_parser(list_parser)
generate_hw_parser = subparser.add_parser(
"hw-generate",
update_hardware_config_parser = subparser.add_parser(
"update-hardware-config",
help="Generate hardware specifics for a machine",
description="""
Generates hardware specifics for a machine. Such as the host platform, available kernel modules, etc.
@@ -84,7 +84,7 @@ For more detailed information, visit: https://docs.clan.lol/getting-started/conf
"""
),
)
register_hw_generate(generate_hw_parser)
register_update_hardware_config(update_hardware_config_parser)
install_parser = subparser.add_parser(
"install",

View File

@@ -226,7 +226,7 @@ class HardwareGenerateOptions:
force: bool | None
def hw_generate_command(args: argparse.Namespace) -> None:
def update_hardware_config_command(args: argparse.Namespace) -> None:
opts = HardwareGenerateOptions(
flake=args.flake,
machine=args.machine,
@@ -242,8 +242,8 @@ def hw_generate_command(args: argparse.Namespace) -> None:
print(f"Type: {hw_info.file}")
def register_hw_generate(parser: argparse.ArgumentParser) -> None:
parser.set_defaults(func=hw_generate_command)
def register_update_hardware_config(parser: argparse.ArgumentParser) -> None:
parser.set_defaults(func=update_hardware_config_command)
machine_parser = parser.add_argument(
"machine",
help="the name of the machine",