From 8a8b4732362ac3dcd6572668094abae015ea3ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 20 Sep 2024 13:39:53 +0200 Subject: [PATCH] rename hw-generate to update-hardware-config --- checks/installation/flake-module.nix | 2 +- docs/site/getting-started/configure.md | 4 ++-- pkgs/clan-cli/clan_cli/machines/cli.py | 8 ++++---- pkgs/clan-cli/clan_cli/machines/hardware.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/checks/installation/flake-module.nix b/checks/installation/flake-module.nix index ecfcd7b2d..485298e21 100644 --- a/checks/installation/flake-module.nix +++ b/checks/installation/flake-module.nix @@ -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: diff --git a/docs/site/getting-started/configure.md b/docs/site/getting-started/configure.md index 1341d8dde..43cf326c9 100644 --- a/docs/site/getting-started/configure.md +++ b/docs/site/getting-started/configure.md @@ -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. `` !!! 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`. diff --git a/pkgs/clan-cli/clan_cli/machines/cli.py b/pkgs/clan-cli/clan_cli/machines/cli.py index e371317e8..8bffbd8f1 100644 --- a/pkgs/clan-cli/clan_cli/machines/cli.py +++ b/pkgs/clan-cli/clan_cli/machines/cli.py @@ -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", diff --git a/pkgs/clan-cli/clan_cli/machines/hardware.py b/pkgs/clan-cli/clan_cli/machines/hardware.py index dc48c6305..5e59b63de 100644 --- a/pkgs/clan-cli/clan_cli/machines/hardware.py +++ b/pkgs/clan-cli/clan_cli/machines/hardware.py @@ -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",