Commit Graph

109 Commits

Author SHA1 Message Date
Qubasa
dfd550f9be clan-cli: cleanup broken deployment cache 2025-03-20 00:17:36 -07:00
Michael Hoang
d79d1811d6 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
r17x
e9ffd923d5 fix(clan-cli): fix cross system 2025-02-26 14:27:00 +07:00
lassulus
300aaa48e7 clan-cli: use new flake caching for machines 2025-02-23 15:58:03 +01:00
lassulus
2a8f40e91a clan_cli machines: use Flake instead of FlakeId 2025-02-07 06:26:09 +01:00
Michael Hoang
da4d7fa365 machines: don't build on target machine if remote builders can be used 2024-12-21 10:43:17 +11:00
lassulus
9cc3bdbc9f vars: eval finalScript lazy 2024-12-14 13:38:51 +01:00
Qubasa
b9091beff9 clan-cli: Replace log.info to machine.info if applicable 2024-12-12 15:36:17 +01:00
lassulus
998ff92b51 vars: remove intermediate classes 2024-12-10 14:04:31 +01:00
Jörg Thalheim
e2ed57f8dd extract nix_test_store helper for sandbox builds 2024-12-05 11:38:58 +01:00
Jörg Thalheim
0b3816b6ec clan/update: make build-host overridable in cli 2024-12-03 17:40:12 +01:00
Jörg Thalheim
760126d8d5 remove deprecated deploymentHost 2024-12-03 17:30:02 +01:00
Jörg Thalheim
bbb2aca5cb rename run_no_output to run_no_stdout
we want stderr for some nix commands.
2024-12-03 17:15:28 +01:00
DavHau
fbbfcc0aa5 vars: generate docs for cli and module 2024-11-29 17:23:31 +07:00
clan-bot
894e31f983 Merge pull request 'remove secretsUploadDirectory from common module' (#2509) from lassulus/clan-core:no-secrets-upload-dir into main 2024-11-28 15:46:51 +00:00
lassulus
8337a3ec41 vars: remove secretsUploadDirectory from common module 2024-11-28 16:38:06 +01:00
Qubasa
1f98df96e3 clan-cli: cmd.run now has its options extracted to a dataclass 2024-11-28 15:26:37 +01:00
Johannes Kirschbauer
fa7e9a9670 Cli: improve targetHost error message 2024-11-27 10:06:04 +01:00
DavHau
44e6fe803f vars: make all python tests work in nix sandbox
- generate a flake.lock file for each template by copying the clan-core flake.lock and modifying it

- call nix build with --store for tests inside the sandbox
2024-11-27 14:32:02 +07:00
Jörg Thalheim
c9e80f38ca vars: make interface more type-safe 2024-11-26 17:08:26 +01:00
Qubasa
979e5e839d clan-cli: Refactor ssh part 2, Refactor custom_logger 2024-11-22 22:08:50 +01:00
Qubasa
a4f3d9d1fc clan-cli: Refactor ssh folder part 1 2024-11-21 13:02:22 +01:00
lassulus
ddc7afd67d clan_cli vars: actually upload 2024-11-13 13:23:42 +01:00
Jörg Thalheim
5bc8670020 simplify reading hostPlaform.system from nixos 2024-11-11 16:17:54 +01:00
Qubasa
9da872a267 clan-cli: Simplify hostPlatform and just use 'system' 2024-11-11 14:08:12 +00:00
Qubasa
9fc4e4c7d4 clan-cli: Fix nixos-anywhere for systems that can not be build locally 2024-11-11 14:08:12 +00:00
Qubasa
99c5bd2b50 clan-cli: Add --host-key-check to machine update 2024-10-05 23:33:44 +02:00
Qubasa
5967bb347c clan-cli: Fix bug where --target_host is getting ignored 2024-10-05 18:51:44 +02:00
DavHau
0a8b7f38a8 vars: implement migration
Migrating generated files from the facts subsystem to the vars subsystem is now possible.

HowTo:
1. declare `clan.core.vars.generators.<generator>.migrateFact = my_service` where `my_service` refers to a service from `clan.core.facts.services`
2. run `clan vers generate your_machine` or `clan machines update your_machine`

Vars will only be migrated for a generator if:
1. The facts service specified via `migrateFact` does exist
2. None of the vars to generate exist yet
3. All public var names exist in the public facts store
4. All secret var names exist in the secret fact store

If the migration is deemed possible, the generator script will not be executed. Instead the files from the public or secret facts store are read and stored into the corresponding vars store
2024-09-19 17:57:03 +02:00
DavHau
3089296328 clan-cli: fix cyclic import problem 2024-09-06 15:38:12 +02:00
DavHau
5cd9960ed4 vars: improve generator execution pipeline
- ensure all dependents are re-generated as well
- refactor: separate out computation of generator update closure
2024-09-06 14:30:49 +02:00
Jörg Thalheim
ddd2a1a4f7 only accept eval/build for nix command 2024-09-03 10:49:53 +02:00
Jörg Thalheim
cb16cda3fa add RET, Q, RSE lint 2024-09-02 15:58:49 +02:00
Johannes Kirschbauer
c2d088b245 UI: AdminSettings page 2024-09-02 15:08:36 +02:00
Jörg Thalheim
e150b37fb8 enable ASYNC, DTZ, YTT and EM lints 2024-09-02 14:07:06 +02:00
Jörg Thalheim
22d6e5e153 enable comprehensions linting rules 2024-09-02 13:35:52 +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
Jörg Thalheim
fe99fb8e34 remove 'Extra config:' warning 2024-07-24 20:04:31 +02:00
Qubasa
31161322d6 clan-vm-manager: Fix waypipe regression in nix code 2024-07-23 13:20:02 +02:00
Qubasa
131299694b clan-vm-manager: Restore to known good version 2024-07-19 22:07:34 +02:00
DavHau
e7d5a6f854 impure-checks: improve performance by disabling dynamic deps 2024-07-16 12:42:45 +07:00
Mic92
a3e2b76517 Merge branch 'main' into DavHau-dave 2024-07-09 09:33:11 +00:00
DavHau
941cf9fb9d vars: implement generating public variables via in_repo 2024-07-09 14:26:56 +07:00
Johannes Kirschbauer
edcc1a5cb2 Test: fixup 2024-07-06 17:51:46 +02: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
2f1dac6962 make machine class now a dataclass 2024-07-03 12:34:43 +02:00
Jörg Thalheim
cc3f99bfaa simplify clan uri further 2024-07-02 12:52:10 +02:00