Commit Graph

2096 Commits

Author SHA1 Message Date
Johannes Kirschbauer
7ab0e8377b docs/api: add docstrings to {get_generators, run_generators} 2025-07-07 15:22:44 +02:00
hsjobeki
0532284387 Merge pull request 'api/generators: remove term 'vars' interact purely with 'generators'' (#4242) from api-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4242
2025-07-07 13:04:00 +00:00
Johannes Kirschbauer
5b6f5e812b api/hw: rename generate_machine_hardware_info into 'run' 2025-07-07 14:04:39 +02:00
Johannes Kirschbauer
fcc3387332 api/generators: remove term 'vars' interact purely with 'generators' 2025-07-07 13:59:12 +02:00
hsjobeki
7001a82196 Merge pull request 'api/tasks: prefix impure actions with run' (#4239) from api-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4239
2025-07-07 11:28:07 +00:00
Johannes Kirschbauer
6560738502 api/machine checks: rename, add checkResult 2025-07-07 13:13:00 +02:00
Johannes Kirschbauer
19d86cc431 api/clan: rename 'update_clan_meta' -> 'set_clan_details' 2025-07-07 12:51:32 +02:00
Johannes Kirschbauer
97c27b9449 api/keygen: add todo comment 2025-07-07 12:49:37 +02:00
Johannes Kirschbauer
1180ace4d7 api/admin: remove maybe_get_admin_public_keys 2025-07-07 12:43:11 +02:00
DavHau
ed0b86385b Refactor StoreBase to take machine name string instead of Machine object
- Updated StoreBase.__init__ to accept machine: str and flake: Flake
- Modified all StoreBase subclasses (in_repo, vm, fs, sops, password_store) to match new signature
- Added select_machine method to Flake class for machine-specific attribute selection
- Updated Machine.select to use the new Flake.select_machine method
- Fixed all test cases to pass machine name and flake to store constructors
- Maintained backward compatibility by keeping the same external API

This reduces coupling between the store system and the Machine class,
making the architecture more modular and flexible.
2025-07-07 10:24:11 +00:00
Johannes Kirschbauer
3a237796d9 api/tasks: prefix impure actions with run 2025-07-07 12:09:43 +02:00
hsjobeki
979d5dcdd1 Merge pull request 'api/clan: rename 'show_clan_meta' -> 'get_clan_details'' (#4236) from api-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4236
2025-07-07 10:00:10 +00:00
Johannes Kirschbauer
972059ebe4 api: rename to get_flash_options 2025-07-07 10:48:14 +02:00
Johannes Kirschbauer
1c33f30135 api/clan: rename 'show_clan_meta' -> 'get_clan_details' 2025-07-07 10:41:00 +02:00
Michael Hoang
5667ad2994 cli: don't log every public key we find 2025-07-07 15:23:46 +10:00
lassulus
ccd7e3d91d vars password-store: fix secret mangling due to string encoding 2025-07-07 02:35:17 +02:00
lassulus
bbb7773567 rename lingering clan.vars -> clan.core.vars 2025-07-07 00:59:52 +02:00
hsjobeki
891402760f Merge pull request 'API: refactor into resource oriented names' (#4223) from api-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4223
2025-07-06 19:11:31 +00:00
Johannes Kirschbauer
045e297438 vars/api: rename 'get_generators_closure' into 'get_machine_generators' 2025-07-06 20:57:42 +02:00
Johannes Kirschbauer
360766f7a6 api/flash: refactor into 'list_flash_options' 2025-07-06 20:57:42 +02:00
Johannes Kirschbauer
ad48771c98 vars/api: rename, unregister some unused vars functions 2025-07-06 20:57:42 +02:00
Johannes Kirschbauer
7370212ec2 Vars: rename public functions into 'create_machine_vars' 2025-07-06 20:57:42 +02:00
Johannes Kirschbauer
3af529d76e Vars: rename 'keygen' to 'create_secrets_user' 2025-07-06 20:57:42 +02:00
Johannes Kirschbauer
76da95c6ba Templates/cli: move display command into it own category 2025-07-06 19:36:57 +02:00
Johannes Kirschbauer
d49ff467db Templates: remove InputPrio and related classes 2025-07-06 19:08:45 +02:00
Johannes Kirschbauer
f2db543651 Templates: migrate clan templates to flake identifiers 2025-07-06 15:37:10 +02:00
lassulus
5845b3f90d Merge pull request 'Revert "make host key check an enum instead of an literal type"' (#4220) from revert_host_key_check into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4220
2025-07-06 13:19:00 +00:00
lassulus
045b250f9a Revert "make host key check an enum instead of an literal type"
This reverts commit 3d83017acd.
2025-07-06 14:51:19 +02:00
hsjobeki
254569481a Merge pull request 'Templates/list: display templates via exposed nix value' (#4219) from templates-list into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4219
2025-07-06 12:49:58 +00:00
Johannes Kirschbauer
adb726c318 Templates/list: display templates via exposed nix value 2025-07-06 14:37:03 +02:00
lassulus
2f0f9a9fba vars/password-store: replace passBackend option with passPackage
The `clan.core.vars.settings.passBackend` option has been replaced with
`clan.vars.password-store.passPackage` to provide better type safety and
clearer configuration.

Changes:
- Remove problematic mkRemovedOptionModule that caused circular dependency
- Add proper option definition with assertion-based migration
- Users setting the old option get clear migration instructions
- Normal evaluation continues to work for users not using the old option

Migration: Replace `clan.core.vars.settings.passBackend = "passage"`
with `clan.vars.password-store.passPackage = pkgs.passage`
2025-07-06 12:46:39 +02:00
Johannes Kirschbauer
87fc3e01d1 cli/update: refactor machine selection logic into 'get_machines_for_update' 2025-07-06 12:27:28 +02:00
Johannes Kirschbauer
605a0242c2 CLI: update requireExplicitUpdate in help 2025-07-06 12:22:25 +02:00
lassulus
453aec3273 clan_cli machines update: remove caching of sometimes missing pass config
This config value is not set if people don't use pass, it's also at the wrong location
We could cache it with a maybe, but we plan to move it anyway
2025-07-05 18:39:53 +02:00
DavHau
bfc8c4c399 refactor: reduce coupling to Machine class in vars module
- Change Generator class to store machine name as string instead of Machine reference
- Update Generator.generators_from_flake() to only require machine name and flake
- Refactor check_vars() to accept machine name and flake instead of Machine object
- Create Machine instances only when needed for specific operations

This continues the effort to reduce dependencies on the Machine class,
making the codebase more modular and easier to refactor.
2025-07-05 16:30:05 +07:00
DavHau
3d2ede9f8e refactor: remove Machine.vars_generators() method
Replace all calls to machine.vars_generators() with direct calls to
Generator.generators_from_flake() to make the dependency more explicit
and remove unnecessary indirection.

This reduces coupling to the Machine class, making the codebase more
modular and easier to refactor in the future.
2025-07-05 15:26:31 +07:00
Mic92
44312657aa Merge pull request 'Qubasa-hsjobeki/bump-nixpkgs' (#4205) from Qubasa-hsjobeki/bump-nixpkgs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4205
2025-07-04 16:47:23 +00:00
Qubasa
0d1e1d9796 treefmt/ruff: Set python lint version to 3.13. Fix all new lints coming up. 2025-07-04 17:11:31 +02:00
Jörg Thalheim
f24e1beb98 only override identify/host_key_check in a single place 2025-07-04 14:36:05 +02:00
Jörg Thalheim
3d83017acd make host key check an enum instead of an literal type
this is more typesafe at runtime.
2025-07-04 14:36:05 +02:00
Jörg Thalheim
0bd66be152 add -i option to update-hardware-config 2025-07-04 14:14:28 +02:00
hsjobeki
2c8b457fd5 Merge pull request 'Clan_lib: add filtering by tag to list API' (#4197) from cli-fixup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4197
2025-07-04 11:53:43 +00:00
Johannes Kirschbauer
41cafe828f Clan_lib: add filtering by tag to list API 2025-07-04 09:48:21 +02:00
Johannes Kirschbauer
b0c24edd48 cli: move some references to duplicate list machines 2025-07-04 09:32:43 +02:00
DavHau
67a37a9d2c reverting b1f71fe4fb 2025-07-04 10:35:30 +07:00
lassulus
c760561dbd refactor: remove _serialized field and implement efficient vars selection
- Remove _serialized field from vars interface to prevent serialization
  errors with throwing passBackend field
- Implement direct selection of generator fields using multi-select syntax
- Refactor vars_generators() to use new Generator.from_flake() method that
  selects only safe fields (avoiding non-serializable values)
- Remove unused legacy methods: Generator.from_json(), Var.from_json(),
  Prompt.from_json()
- Update precaching to match new selection approach

This fixes the serialization errors that were preventing vars from working
with the new password-store implementation by avoiding the problematic
_serialized field entirely.
2025-07-03 18:53:36 +02:00
lassulus
a055b4d1eb refactor: remove deployment.json and use direct selectors
- Remove deployment.json file generation from outputs.nix
- Add throw for deprecated deployment.file usage with upgrade instructions
- Remove vars data from deployment.data
- Update Machine class to use direct select() calls instead of deployment property
- Update all deployment property accesses to use direct selectors
- Add precaching for frequently accessed values in update.py:
  - Module paths for facts and vars
  - Deployment settings (requireExplicitUpdate, nixosMobileWorkaround)
  - Services and generators data
  - Secret upload locations
- This removes unnecessary JSON serialization and makes the code more composable
2025-07-02 20:56:23 +02:00
Johannes Kirschbauer
9932f170ca machines/update: queue update only for machines_to_update 2025-07-02 19:05:37 +02:00
Johannes Kirschbauer
b1f71fe4fb clan.deployment: unify deprecated option 2025-07-02 18:37:29 +02:00
Mic92
fb3685d721 Merge pull request 'vars: make debug logging less verbose' (#4171) from merge-when-green-joerg into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4171
2025-07-02 11:48:59 +00:00