rename hw-generate to update-hardware-config
This commit is contained in:
@@ -99,7 +99,7 @@
|
|||||||
client.wait_until_succeeds("timeout 2 ssh -o StrictHostKeyChecking=accept-new -v root@target hostname")
|
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.succeed("cp -r ${../..} test-flake && chmod -R +w test-flake")
|
||||||
client.fail("test -f test-flake/machines/test-install-machine/hardware-configuration.nix")
|
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("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")
|
client.succeed("clan machines install --debug --flake ${../..} --yes test-install-machine root@target >&2")
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -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:
|
Generate the `hardware-configuration.nix` file for your machine by executing the following command:
|
||||||
|
|
||||||
```bash
|
```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>`
|
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
|
!!! Example
|
||||||
```bash
|
```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`.
|
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`.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import argparse
|
|||||||
|
|
||||||
from .create import register_create_parser
|
from .create import register_create_parser
|
||||||
from .delete import register_delete_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 .import_cmd import register_import_parser
|
||||||
from .install import register_install_parser
|
from .install import register_install_parser
|
||||||
from .list import register_list_parser
|
from .list import register_list_parser
|
||||||
@@ -64,8 +64,8 @@ Examples:
|
|||||||
)
|
)
|
||||||
register_list_parser(list_parser)
|
register_list_parser(list_parser)
|
||||||
|
|
||||||
generate_hw_parser = subparser.add_parser(
|
update_hardware_config_parser = subparser.add_parser(
|
||||||
"hw-generate",
|
"update-hardware-config",
|
||||||
help="Generate hardware specifics for a machine",
|
help="Generate hardware specifics for a machine",
|
||||||
description="""
|
description="""
|
||||||
Generates hardware specifics for a machine. Such as the host platform, available kernel modules, etc.
|
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_parser = subparser.add_parser(
|
||||||
"install",
|
"install",
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ class HardwareGenerateOptions:
|
|||||||
force: bool | None
|
force: bool | None
|
||||||
|
|
||||||
|
|
||||||
def hw_generate_command(args: argparse.Namespace) -> None:
|
def update_hardware_config_command(args: argparse.Namespace) -> None:
|
||||||
opts = HardwareGenerateOptions(
|
opts = HardwareGenerateOptions(
|
||||||
flake=args.flake,
|
flake=args.flake,
|
||||||
machine=args.machine,
|
machine=args.machine,
|
||||||
@@ -242,8 +242,8 @@ def hw_generate_command(args: argparse.Namespace) -> None:
|
|||||||
print(f"Type: {hw_info.file}")
|
print(f"Type: {hw_info.file}")
|
||||||
|
|
||||||
|
|
||||||
def register_hw_generate(parser: argparse.ArgumentParser) -> None:
|
def register_update_hardware_config(parser: argparse.ArgumentParser) -> None:
|
||||||
parser.set_defaults(func=hw_generate_command)
|
parser.set_defaults(func=update_hardware_config_command)
|
||||||
machine_parser = parser.add_argument(
|
machine_parser = parser.add_argument(
|
||||||
"machine",
|
"machine",
|
||||||
help="the name of the machine",
|
help="the name of the machine",
|
||||||
|
|||||||
Reference in New Issue
Block a user