Commit Graph

353 Commits

Author SHA1 Message Date
Michael Hoang
54e3414cef machines: minor refactor of update 2025-04-13 18:14:17 +02:00
Johannes Kirschbauer
de587648f8 chore(clan/pytest): discover all test files in the tree 2025-04-09 18:54:57 +02:00
Johannes Kirschbauer
ab9c0d2904 fix(clan/machines): move machineClass attribute selector and add a unit test for class detection 2025-04-09 18:29:43 +02:00
Jörg Thalheim
20f00c938f hardware: only include sshpass if we are actually using it. 2025-04-09 09:52:56 +00:00
Michael Hoang
72ed0e258a cli: don't update macOS machines 2025-04-08 08:53:29 +02:00
Michael Hoang
bbe12002d8 cli: managed by clan -> managed by Clan 2025-04-03 00:25:51 +09:00
Michael Hoang
2db14e0ffa cli: machines update [MACHINE] -> machines update [MACHINES] 2025-04-03 00:25:51 +09:00
Qubasa
6f13b3a29c clan-cli: Fix deployment as non root edgecase 2025-03-31 20:25:05 +02:00
Qubasa
8e2005f38c clan-cli: Fix deployment as non root with a buildHost set 2025-03-28 18:47:36 +01:00
Qubasa
d1a79653fe checks/installation-without-system: modify to install through normal user instead of root 2025-03-26 18:37:31 +01:00
RTUnreal
351ce1414a clan_cli: fix support for non-root deployment user 2025-03-26 18:37:31 +01:00
Qubasa
047b767054 clan-cli: cleanup broken deployment cache 2025-03-20 00:17:36 -07:00
Jörg Thalheim
93cbe62765 always resolve symlinks for TemporaryDirectory
On macOS mktemp returns a temporary directory in a symlink.
Nix has a bug where it won't accept path:// located in a symlink.
This avoid this issue by always resolving symlinks as returned by
TemporaryDirectory.
2025-03-19 16:47:18 +01:00
Louis Opter
039b309255 clan-cli: do not crash if a machine being deleted is missing from the inventory
We implement that by actually raising `KeyError` in `inventory.delete_by_path`
(as advertised in the docstring), since it makes more sense to catch a
`KeyError` than a generic `ClanError`.
2025-03-19 10:53:38 +00:00
Louis Opter
538374558d clan-cli: machines delete: delete the machine's vars and secrets
When a machine is deleted with `clan machines delete`, remove its
vars and legacy secrets, and update any secrets that reference the
machine's key.

This command is a superset of `clan secrets machine delete`, and I am
wondering if we could remove the `clan secrets machine` subcommand,
unless there is an use case for having a machine defined without its
key, and any secrets/vars?

Note:

- This deletes the `ListSecretsOptions` dataclass, as it did not seem to
  bring any value, especially since `list_secrets` was receiving its
  individual members instead of the whole dataclass. We can always bring
  it back if complexity grows to demand it.
2025-03-19 10:53:38 +00:00
Michael Hoang
e215a9db6e install: let nixos-anywhere determine where to build automatically
This fixes installing machines that don't have `system` defined i.e.
when running `clan machines install` with `--update-hardware-config`.
2025-03-10 12:30:03 +09:00
Qubasa
0da1a05b55 clan-cli: Remove can_build_locally and replace with nixos-anywhere --build-on auto 2025-03-01 17:52:41 +01:00
r17x
456b25c921 fix(clan-cli): fix cross system 2025-02-26 14:27:00 +07:00
lassulus
5ac629f549 clan-cli: use new flake caching for machines 2025-02-23 15:58:03 +01:00
lassulus
3121c5ecdb machines install: fix installation via tor 2025-02-22 03:39:42 +00:00
Jörg Thalheim
1f3bd09245 fix regex for detecting git+file inputs 2025-02-20 10:00:04 +07:00
Qubasa
03ce74fc74 clan-clI: Improve error message of clan update-hardware-config on non found nixos-facter 2025-02-18 17:40:27 +07:00
Michael Hoang
af228db398 machines: hide morph 2025-02-17 00:22:14 +07:00
Pablo Ovelleiro Corral
b0e7de3c8b Create directory 2025-02-16 17:08:54 +00:00
Pablo Ovelleiro Corral
014aec9531 Fix output when rebuilding 2025-02-16 17:08:54 +00:00
Michael Hoang
160bbfcb37 cli: add morph command 2025-02-16 21:31:28 +07:00
Michael Hoang
bc53c7a886 cli: make some functions only create commits optionally 2025-02-16 21:14:09 +07:00
Johannes Kirschbauer
153b5560c3 Cli: delete machines bugfix. Dont modify the inventory in other places 2025-02-15 09:03:54 +07:00
Sacha Korban
0eaaabcf63 clan-cli: machines install: add phases option for nixos-anywhere 2025-02-13 17:10:02 +11:00
Johannes Kirschbauer
9b706c148b Inventory: automatically create emtpy file on write 2025-02-10 09:02:23 +00:00
Johannes Kirschbauer
dee284d669 CLI: machine create use patch inventory for partial updates 2025-02-10 09:02:23 +00:00
lassulus
32748c14f4 clan_cli machines: use Flake instead of FlakeId 2025-02-07 06:26:09 +01:00
Qubasa
decf340258 clan-cli: Fix incorrect input handling in get_templates 2025-02-04 08:10:32 +00:00
Qubasa
0f4cdd31cd clan-cli: Make clan machines create use templating.py 2025-01-31 18:07:48 +07:00
Qubasa
7545a9a883 clan-cli: Make clan flakes create discover templates from inputs. Add clan flakes list command 2025-01-30 16:24:50 +07:00
a-kenji
ce148c23a5 Fix various typos 2025-01-22 13:19:28 +01:00
Jörg Thalheim
62c6da4c32 clan/update: deploy_machine -> deploy_machines 2025-01-21 15:20:38 +01:00
Michael Hoang
0ec38c7919 vars: support secrets for partitioning the disk 2025-01-21 11:13:51 +00:00
Jörg Thalheim
c5a72f67c3 use nix flake archive in clan machines update for git+file flake inputs 2025-01-20 10:49:25 +01:00
Michael Hoang
01d86b6482 install: support -i flag for specifying SSH private key 2025-01-19 18:53:18 +11:00
Jörg Thalheim
c4a1e3ec95 switch to nixos-facter for hardware-config 2025-01-15 13:59:49 +00:00
Qubasa
5b51950e6d docs: Add debugging.md and repo-layout.md guides 2025-01-09 13:01:49 +00:00
Johannes Kirschbauer
d5e54d262b API: Disk templates, persist original values 2025-01-07 10:21:47 +01:00
Michael Hoang
7aa275a5b4 install: upload vars needed for activation for installation 2024-12-22 05:53:26 +00:00
Michael Hoang
27849a61db machines: don't build on target machine if remote builders can be used 2024-12-21 10:43:17 +11:00
DavHau
b451d7c3ff machines update: remove unecessary special handling for non-path flakes 2024-12-20 19:23:25 +07:00
Qubasa
94b99034c9 clan-cli: Fix clan install command and multiple other issues 2024-12-18 15:29:08 +01:00
a-kenji
1596ecdb3d pkgs/cli: Fix target_host for machines install
Use the correct `target_host`, if a user is defined.

Before the change:

```console
$ clan machines install
$ Install jon to 49.13.232.197? [y/N]
```

After the change:

```console
$ clan machines install
$ Install jon to root@49.13.232.197? [y/N]
```

Because root is the configured user for `target_host`, this is the
correct behavior.
2024-12-17 22:29:54 +01:00
Michael Hoang
abd145aaaa clan_cli: always use --target-host if specified for machines install 2024-12-18 00:13:17 +11:00
Michael Hoang
0ca2e7f728 clan_cli: fix target_host when running clan machines install 2024-12-18 00:08:10 +11:00