Commit Graph

33 Commits

Author SHA1 Message Date
Jörg Thalheim
f3a6fe8870 Flake: remove unused variable and mark other fields as non-init 2025-05-07 14:40:22 +02:00
hsjobeki
f6b0b5ada5 Merge pull request 'API(cli): add method to Flake class to allow calling nix functions' (#3502) from hsjobeki/clan-core:improvements-2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3502
2025-05-05 20:16:28 +00:00
Johannes Kirschbauer
dfa5a228e8 feat(clanLib): init evalServiceSchema 2025-05-05 21:55:29 +02:00
Johannes Kirschbauer
750cca1991 API(cli): add method to Flake class to allow calling nix functions 2025-05-05 21:46:20 +02:00
lassulus
8eeea85a16 clan-cli select: fix returning early on list select 2025-05-02 00:16:21 +09:00
lassulus
fc1f563f7a clan_cli flake caching: fix caching of store files 2025-05-01 13:40:12 +09:00
Michael Hoang
2f95d2edf2 cli: fallback to bundled Nixpkgs 2025-04-28 13:10:00 +10:00
Michael Hoang
c3842902ac cli: don't use select from clanLib 2025-04-28 12:52:00 +10:00
Michael Hoang
4c2584e246 lib: move select.select -> select for backwards compat with old CLIs 2025-04-25 17:30:06 +10:00
lassulus
d93e58218d Refactor select with new maybe selector
This is a great refactor of the select functionality in the flake class.
This now uses the same parser as the nix code, but runs it in python for
nice stacktraces.

Also we now have a maybe selector which can be used by prepending the
selector with a ?

Tests have been expanded to make sure the code is more stable and easier
to understand
2025-04-25 16:26:45 +10:00
Johannes Kirschbauer
8efdfc6da1 chore(select/cache): rename 'prefetch' to 'invalidate_cache' 2025-04-20 13:34:52 +02:00
lassulus
62deb1f89b Merge pull request 'fast-vars-gen' (#3216) from fast-vars-gen into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3216
2025-04-15 07:11:06 +00:00
Jörg Thalheim
949536bb2b rework cache to use json instead of pickle
Pickle can silently break if migrate our data layout and also introduces
unwanted behaviour such as code injection that we want to avoid.
2025-04-15 07:00:00 +00:00
lassulus
da92c19367 clan_cli vars generate: prefetch all validationHashes for faster eval 2025-04-14 14:28:59 +02:00
Johannes Kirschbauer
ae8e7edac0 feat(clanLib): expose clanInternals.clanLib
This is usefully for:
- As api via python
- for testing clanLib downstream
2025-03-30 17:07:11 +02:00
Jonathan Thiessen
3c0c2ce9d6 Fix cached None support in FlakeCacheEntry
Previously, you could cache None values; however,
insertion wasn't idempotent/identical reinsertion
would lead to errors due to missing None checks.
2025-03-30 04:33:30 +00:00
Jonathan Thiessen
d4fa480262 Add overlapping (consistent) flake cache insert test
* Additionally, update `insert`'s input type hint to support None values
  (as they are already selectable and (one shot) insertable).
  This is necessary to appease the linter wrt the added test.
2025-03-30 04:33:30 +00:00
Qubasa
63a0e5f35d clan-cli: Fix templates not downloading template, Make templates use Flake cache, Fix flake cache exception on conditional attribute, add more tests 2025-03-19 10:30:52 +00:00
Jörg Thalheim
903831acaf don't log cache miss by default
This is expected and happens regular, so there is no value in logging
this.
2025-03-11 12:03:55 +01:00
Qubasa
5c4fc7b852 clan-cli: Make Lix compatible again 2025-03-07 14:06:35 +01:00
lassulus
e3ce93a6ff clan-cli: check if paths exist in cache check 2025-02-27 02:53:41 +01:00
Qubasa
ba2865e940 clan-cli: Fix flake.py missing cache eviction if there is a garbage collected path 2025-02-27 01:01:50 +01:00
lassulus
300aaa48e7 clan-cli: use new flake caching for machines 2025-02-23 15:58:03 +01:00
lassulus
14f49512ed clan-cli flake caching: fix selectors not merging 2025-02-15 09:59:41 +00:00
lassulus
0767eadb81 clan-cli: hash the flake_hash to remove unwanted character from path 2025-02-15 09:59:41 +00:00
lassulus
2dbdb61438 clan-cli: add persistant flake caching 2025-02-10 13:29:01 +00:00
lassulus
7d8c72f9bc clan_cli flake caching: support outPath 2025-02-10 04:33:37 +00:00
lassulus
2a8f40e91a clan_cli machines: use Flake instead of FlakeId 2025-02-07 06:26:09 +01:00
lassulus
9195fe4ca2 clan-cli: test_flake_caching: add actual flake caching test 2025-02-05 10:17:37 +00:00
a-kenji
1629fb68bd pkgs/clan: Remove select debug prints 2025-02-04 07:32:55 +00:00
lassulus
3f19444985 clan_cli: add select command 2025-02-04 07:32:55 +00:00
a-kenji
94362c1ff5 pkgs/clan: Fix typos 2025-02-02 23:20:39 +07:00
lassulus
02d450b905 clan-cli: add a Flake class with caching 2025-02-02 11:52:36 +00:00