Commit Graph

62 Commits

Author SHA1 Message Date
Jörg Thalheim
e150b37fb8 enable ASYNC, DTZ, YTT and EM lints 2024-09-02 14:07:06 +02:00
Jörg Thalheim
109d1faf9e enable bug-bear linting rules 2024-09-02 13:26:07 +02:00
Jörg Thalheim
b313f2d066 make all same-module imports relative, the rest absolute
This makes sorting more consitent.
2024-09-02 13:00:19 +02:00
Johannes Kirschbauer
02662867fb UI: init update machine 2024-08-15 15:08:15 +02:00
Johannes Kirschbauer
90b13dc803 API: init machine update 2024-08-15 15:08:15 +02:00
Johannes Kirschbauer
3522b8ba49 Machine update: fix upload sources from machine flake, instead of current directory 2024-08-15 15:08:15 +02:00
Qubasa
f0a9a7a02b clan-cli: Add --show-trace to nix build and nixos-rebuild commands 2024-08-12 22:27:54 +02:00
DavHau
395c5cbace vars/sops: fix loading of vars from directory structure 2024-07-29 18:01:26 +07:00
DavHau
79d6f8e893 Reapply "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"
This reverts commit 71009f80d8.

workaround upstream bug: https://github.com/NixOS/nixpkgs/issues/324802
2024-07-05 19:29:01 +07:00
Jörg Thalheim
71009f80d8 Revert "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"
This reverts commit 18b64f2d0b.

The old configuration cannot be updated like this:

eve] error:
[eve]        … while calling the 'head' builtin
[eve]          at /nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/lib/attrsets.nix:1575:11:
[eve]          1574|         || pred here (elemAt values 1) (head values) then
[eve]          1575|           head values
[eve]              |           ^
[eve]          1576|         else
[eve]
[eve]        … while evaluating the attribute 'value'
[eve]          at /nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/lib/modules.nix:809:9:
[eve]           808|     in warnDeprecation opt //
[eve]           809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
[eve]              |         ^
[eve]           810|         inherit (res.defsFinal') highestPrio;
[eve]
[eve]        … while evaluating the option `system.build.toplevel':
[eve]
[eve]        … while evaluating definitions from `/nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/nixos/modules/system/activation/top-level.nix':
[eve]
[eve]        … while evaluating the option `assertions':
[eve]
[eve]        … while evaluating definitions from `/nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/nixos/modules/system/boot/systemd.nix':
[eve]
[eve]        … while evaluating the option `systemd.services':
[eve]
[eve]        … while evaluating definitions from `/nix/store/kpzcdgndym0qm1w490mjvk9c2qmz03h5-source/nixosModules/clanCore/zerotier':
[eve]
[eve]        … while evaluating the option `clan.core.networking.zerotier.networkId':
[eve]
[eve]        (stack trace truncated; use '--show-trace' to show the full, detailed trace)
[eve]
[eve]        error: A definition for option `clan.core.networking.zerotier.networkId' is not of type `null or string'. Definition values:
[eve]        - In `/nix/store/kpzcdgndym0qm1w490mjvk9c2qmz03h5-source/nixosModules/clanCore/networking.nix':
[eve]            {
[eve]              _type = "override";
[eve]              content = "267efd4a15b69623";
[eve]              priorit
2024-07-05 11:16:05 +02:00
DavHau
18b64f2d0b clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking} 2024-07-04 17:05:37 +07:00
Jörg Thalheim
6037ad1ce0 move FlakeId to flake id
move FlakeId to flake id
2024-07-03 18:28:55 +02:00
Jörg Thalheim
2f1dac6962 make machine class now a dataclass 2024-07-03 12:34:43 +02:00
Qubasa
cca39c4839 clan-cli: Refactor machines/update.py to cmd.run 2024-06-02 10:00:23 +02:00
a-kenji
32a20caad4 clan: add dynamic completions
Add dynamic completion scaffolding to the clan `cli`.
Also add a dynamic completion mechanism for machines for commands that
have machines as their sole argument.

More intricate dynamic completions will be implemented in follow up
PR's.
2024-05-31 12:55:41 +02:00
Jörg Thalheim
fc3f65fb57 allow to override nix options in update/install/flash commands 2024-05-29 10:14:14 +02:00
a-kenji
578fc55e40 clan: facts generate allow regeneration of facts
Add `--regenerate` flag to `clan facts generate` which allows forcing
the generation of facts, regardless of their current existence.

Examples:
```
clan facts generate [MACHINE] --regenerate
```
or
```
clan facts generate [MACHINE] --service [SERVICE] --regenerate
```
2024-05-26 22:55:48 +02:00
a-kenji
4e87389a4d clan: facts generate specific service
Add `--service` flag to the `clan` cli which allows specifying a certain
service to be generated.

Example:

```
clan facts generate [MACHINE] --service [SERVICE]
```

Fixes #1395
2024-05-26 21:52:56 +02:00
Johannes Kirschbauer
964625630e add cli docs generator 2024-04-30 18:53:00 +02:00
Jörg Thalheim
033e5194fb refactor facts command to regenerate facts for all machines 2024-04-15 22:14:54 +02:00
Jörg Thalheim
448d752db1 fix case when secrets are regenerated during update/install 2024-04-12 14:46:51 +02:00
lassulus
8d34c51df2 refactor secrets & facts -> secret_facts & public_facts 2024-03-23 05:46:54 +01:00
Jörg Thalheim
5afd5baeb2 add requireExplicitUpdate option for mobile devices 2024-02-06 17:55:34 +01:00
Jörg Thalheim
8f74f257e7 add support for build machines 2024-02-06 17:21:42 +01:00
Jörg Thalheim
5e5077c31c rename machine.host to machine.target_host 2024-02-06 17:21:42 +01:00
Jörg Thalheim
7d62e147a9 rename target_host to target_host_address 2024-02-06 17:21:42 +01:00
Jörg Thalheim
0745bcb9a0 machines/update: get flake_attr from machine class 2024-02-06 17:21:42 +01:00
Jörg Thalheim
8db4d31a52 skip machines without target_host when running clan machines update 2024-02-06 15:04:19 +01:00
Jörg Thalheim
d36aea3f73 move checks if targetHost/buildHost is set to cli 2024-02-06 14:51:44 +01:00
lassulus
3f2f3012b9 clan-cli update: remove legacy argument 2024-02-03 07:53:15 +01:00
lassulus
06c2734c9b clan-cli update: upload only local paths from localhost 2024-02-03 07:53:15 +01:00
Jörg Thalheim
584299e199 rename deployment address to target address
This is a prepares having a build server for deployment
2024-02-02 16:39:29 +07:00
lassulus
8ac9ad3133 clan-cli update: use new Machine class interface 2024-01-24 15:49:12 +01:00
lassulus
bdd1f9be6d machines.Machine: refactor flake_dir -> flake; use Machine class in vm 2024-01-24 15:49:12 +01:00
Qubasa
7049573d28 Refactor subprocess to cmd.py part 2 2024-01-10 12:11:29 +01:00
Jörg Thalheim
7d755beca6 enable more linting 2023-11-29 13:29:45 +00:00
lassulus
d8633dd29d machines.update: remove redundant flake argument 2023-11-15 21:57:08 +01:00
lassulus
efafe6f0e3 clan-cli secrets: flake_name -> flake_dir 2023-11-05 16:58:48 +01:00
lassulus
0600278122 cli machines update: find flake dir automatic if not provided, support flake as path 2023-10-29 20:52:38 +01:00
Qubasa
768b567f21 nix fmt 2023-10-27 19:26:03 +02:00
Qubasa
f976121fa6 Added flake_name:str argument everywhere, nix fmt doesn't complain anymore 2023-10-27 19:15:40 +02:00
Qubasa
b09448ab6b Updated to main 2023-10-27 19:15:11 +02:00
Jörg Thalheim
8daf0607c3 fix updating multiple machines 2023-10-27 17:40:20 +02:00
lassulus
ee76a78aed machines update: add --target-host 2023-10-04 23:28:15 +02:00
lassulus
01087e2da8 clan_cli: refactor secrets code into Machine class 2023-10-04 16:41:16 +02:00
lassulus
0db337d57e clan-cli secrets upload: secrets are populated into tmpdir 2023-09-29 20:05:35 +02:00
lassulus
79be9078dc restore clanInternals with valid nixos config 2023-09-29 19:39:35 +02:00
Jörg Thalheim
cd9cfc5c63 fix secrets script not beeing fetched 2023-09-28 15:51:09 +02:00
Jörg Thalheim
82bf417e17 add toplevel machines-json that can deploy all hosts 2023-09-28 15:23:25 +02:00
Jörg Thalheim
853ddd8e97 clan update: fix deploymentAddress 2023-09-27 21:11:52 +02:00