Commit Graph

8205 Commits

Author SHA1 Message Date
Johannes Kirschbauer
38f98645ac Templates: replace leftover MachineID, by Machine 2025-07-06 15:37:10 +02:00
Johannes Kirschbauer
74d2ae0619 templates_url: add clan template url test 2025-07-06 15:37:10 +02:00
lassulus
c122201ff2 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
e72795904d Revert "make host key check an enum instead of an literal type"
This reverts commit 543c518ed0.
2025-07-06 14:51:19 +02:00
hsjobeki
32ddb4ffa7 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
db6220b57b Templates/list: display templates via exposed nix value 2025-07-06 14:37:03 +02:00
lassulus
e929f36f80 Merge pull request 'vars/password-store: replace passBackend option with passPackage' (#4134) from lassulus/passage_compat into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4134
2025-07-06 11:44:27 +00:00
hsjobeki
f71460c4f9 Merge pull request 'clan-cli: fix incorrect field name in deploy warning messages. The warning for missing buildHost/targetHost always showed targetHost in the path, even when buildHost was the missing field.' (#4217) from pr-4215 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4217
2025-07-06 10:54:55 +00:00
lassulus
8302f3ffde 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
lassulus
bd82de6001 fix(flake): handle file paths with line numbers in cache existence check
The is_cached method now correctly handles store paths that have line
numbers appended (e.g., /nix/store/file.nix:123:456). Previously, these
paths would fail the existence check because the exact path with line
numbers doesn't exist as a file.

The fix adds a helper method that:
- First checks if the exact path exists
- If not, and the path contains colons, validates that the suffix
  consists only of numbers (line:column format)
- If valid, strips the line numbers and checks the base file path

This ensures that cached references to specific file locations are
properly validated while avoiding false positives with files that
have colons in their names.
2025-07-06 12:44:15 +02:00
adeci
06613de825 clan-cli: fix incorrect field name in deploy warning messages. The warning for missing buildHost/targetHost always showed targetHost in the path, even when buildHost was the missing field. 2025-07-06 12:44:02 +02:00
hsjobeki
76af63ee1c Merge pull request 'lib/get_host: improve abstraction, turn missconfiguration into a warning' (#4201) from cli-fixup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4201
2025-07-06 10:38:03 +00:00
Johannes Kirschbauer
3baa43fd87 cli/update: refactor machine selection logic into 'get_machines_for_update' 2025-07-06 12:27:28 +02:00
Johannes Kirschbauer
a6b8ca06ab machines/list: rename helper to instantiate_inventory_to_machines 2025-07-06 12:24:16 +02:00
Johannes Kirschbauer
f7faf2cd63 machines/list: remove duplicate query_machines_by_tags 2025-07-06 12:23:47 +02:00
Johannes Kirschbauer
bff3908bb1 CLI: update requireExplicitUpdate in help 2025-07-06 12:22:25 +02:00
Johannes Kirschbauer
d0613b4030 cli: return validated list from validate_machine_names 2025-07-06 12:22:00 +02:00
Johannes Kirschbauer
52b711667e lib/get_host: improve abstraction, turn missconfiguration into a warning
Motivation: A warning should encourage consistent usage of inventory.machines setting targetHost inside the machine should be considered a custom override

Changing the warning strings to avoid the term 'nix'/'json' both inventory and nixos machines are nix features
2025-07-06 12:08:00 +02:00
lassulus
13d6db98d1 Merge pull request 'better_select_output' (#4213) from better_select_output into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4213
2025-07-06 00:24:06 +00:00
lassulus
195134dd5e clan_cli: better select debug output 2025-07-06 01:17:55 +02:00
lassulus
0670f0ad32 clan_cli flake: remove apply from select, as it will break stuff in horrible ways
Since apply changes the structure of the retuned value, the cache will
be confused about the structure and in subsequent request will use this
wrong structure.

For example: we would use builtins.attrNames on inputs, the flake will
forever think that inputs is a list of strings and will report errors
whenever we try to fetch subkeys from it
2025-07-06 01:17:55 +02:00
lassulus
daf843eeab clan_cli run: add trace runOption to disable verbose traces in debug mode 2025-07-05 19:48:50 +02:00
lassulus
291b742fd7 Merge pull request 'clan_cli machines update: remove caching of sometimes missing pass config' (#4212) from fix_update into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4212
2025-07-05 17:42:45 +00:00
lassulus
f7d6c23aaa 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
d143359a2d 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
448e60f866 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
renovate[bot]
324e934204 chore(deps): update disko digest to da6109c 2025-07-04 16:50:11 +00:00
Mic92
3f6e5968b5 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
Jörg Thalheim
e4c8aba5bc zerotierone: disable tests on macos 2025-07-04 18:39:01 +02:00
Jörg Thalheim
76503b2a92 terminate_process_group: also properly yield iterator when we return early 2025-07-04 18:39:01 +02:00
Jörg Thalheim
d585052007 migrate all projects to python 3.13 linting 2025-07-04 18:39:01 +02:00
Jörg Thalheim
65904d8d8e clan-cli: handle None in union types to prevent TypeError
Add comprehensive test coverage for union types with None to prevent
regression of the issubclass() TypeError that was occurring when
checking if None is in a union type.
2025-07-04 18:39:01 +02:00
Jörg Thalheim
d5aa917ee7 migrate all projects to python 3.13 linting 2025-07-04 18:39:01 +02:00
Mic92
cb9284360f Merge pull request 'change install test to run clan outside of the VM' (#3906) from vm-test into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3906
2025-07-04 15:17:14 +00:00
Qubasa
3f1fdc0aae treefmt/ruff: Set python lint version to 3.13. Fix all new lints coming up. 2025-07-04 17:11:31 +02:00
Johannes Kirschbauer
b35ca4f1a8 Chore: bump nixpkgs 2025-07-04 17:11:31 +02:00
Jörg Thalheim
76e653f37f nixoTestLib: split setting up function for port-forwarding and setuping up flake 2025-07-04 16:56:42 +02:00
Michael Hoang
10737f7d94 Merge pull request 'clanServices/wifi: fix autoConnect setting not doing anything' (#4204) from push-msokoouryrwq into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4204
2025-07-04 14:33:49 +00:00
Michael Hoang
eb54fdc741 clanServices/wifi: fix autoConnect setting not doing anything 2025-07-05 00:05:48 +10:00
pinpox
4aa90f009f Merge pull request 'Re-introduce state-version option' (#4179) from state-version-option-again into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4179
2025-07-04 14:02:05 +00:00
Jörg Thalheim
247151e93f only override identify/host_key_check in a single place 2025-07-04 14:36:05 +02:00
Jörg Thalheim
543c518ed0 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
7f4f11751e nixosTestLib: use xargs for copying store inputs 2025-07-04 14:36:05 +02:00
Jörg Thalheim
a53efb9386 nixosTestLib: substitute dependencies on tools in 2025-07-04 14:36:05 +02:00
Jörg Thalheim
c509f333e4 nixosTestLib: fix various linting issues 2025-07-04 14:36:05 +02:00
Jörg Thalheim
ea93d8fec7 inline create_test_machine again 2025-07-04 14:36:05 +02:00
Jörg Thalheim
68b2aaea89 setup_nix_in_nix: use cp intead of shutil
it's faster and handles symlinks
2025-07-04 14:36:05 +02:00
Jörg Thalheim
1e7453ab04 move nixosTestLib to pkgs/testing 2025-07-04 14:36:05 +02:00
Jörg Thalheim
c148ece02e move setup_nix_in_nix into nixos_test_lib 2025-07-04 14:36:02 +02:00
Jörg Thalheim
b526242744 share more code between installation and update test 2025-07-04 14:14:28 +02:00