Commit Graph

177 Commits

Author SHA1 Message Date
Brian McGee
651b277bb9 feat: configure age plugins for SOPS in buildClan 2025-04-29 16:02:32 +10:00
Johannes Kirschbauer
f6628ec1a9 Refactor(clan_lib): move clan_cli.api into clan_lib.api 2025-04-26 19:51:35 +02:00
Raymond Barbiero
4117eb2f37 clanCore/vars: allow mode to be set
fmt
2025-04-25 11:29:43 +02:00
hsjobeki
841ad6f48e Merge pull request 'vars-fix-overeager-chache-invalidation' (#3385) from hsjobeki/clan-core:vars-fix-overeager-chache-invalidation into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3385
2025-04-22 18:28:27 +00:00
Jörg Thalheim
3ac1907201 use machine.{secrets,public}_{vars,fact}_store everywhere 2025-04-22 18:20:35 +02:00
Johannes Kirschbauer
dc284e1c40 vars: move overeager cache invalidation after one generator closure is regenrated.
Invalidation doesn't need to be done after each generator is executed.
We cannot interpolate values from other generators into another
generator. The generators are executed in order. The finalScript of each
generator stays constant.
After the complete closure is generated the caller of generate may
decide to invalidate the flake cache
2025-04-22 16:42:21 +02:00
Jörg Thalheim
723d72255c Reapply "remove nix_shell_legacy"
This reverts commit c5001f19fc.
2025-04-21 13:23:50 +02:00
Michael Hoang
f574eee5a3 vars: make wording nicer when multiple vars are found 2025-04-18 19:18:42 +02:00
Johannes Kirschbauer
c5001f19fc Revert "remove nix_shell_legacy"
This reverts commit f3512b853a.
2025-04-18 14:49:54 +02:00
Jörg Thalheim
f3512b853a remove nix_shell_legacy 2025-04-16 21:03:58 +02:00
Jörg Thalheim
837789010e rename nix_shell_legacy to nix_shell and run_cmd to nix_shell
Than it's more obvious that we need to migrate.
2025-04-16 18:27:01 +00:00
lassulus
da92c19367 clan_cli vars generate: prefetch all validationHashes for faster eval 2025-04-14 14:28:59 +02:00
Jörg Thalheim
4dc1e2cb3f don't error on macOS if sandbox for vars is missing 2025-04-14 14:11:51 +02:00
Johannes Kirschbauer
d5a32cc453 chore(clan/vars): make no-sandboxing message print a more explizit re-run command 2025-04-10 22:39:27 +02:00
Brian McGee
aa4fe27e51 feat(clan-cli): support multiple keys for a user 2025-04-09 09:58:58 +00:00
DavHau
82b6a52c7c vars: add feature --no-sandbox
Raise warning if sandbox cannot be used -> request user to run with --no-sandbox
2025-04-09 15:02:20 +07:00
Jörg Thalheim
721f61eaed only compute final_script and validation hashes once 2025-04-04 18:31:12 +02:00
Jonathan Thiessen
89379f103a Make Generator's validation dynamic
* Switch `Generator`'s `validation` from a regular property to
  an `@property` annotated method backed by `Machine`'s `eval_nix()`.
* Ensure that `Machine`'s flake cache is flushed after each
  effectful generator execution (rather than only after all
  generators have been executed).
2025-03-30 04:33:30 +00:00
DavHau
48fa29afad vars/prompts: print var name even if custom description is set 2025-03-26 10:48:05 +00:00
Jörg Thalheim
43035b85a5 always resolve symlinks for TemporaryDirectory
On macOS mktemp returns a temporary directory in a symlink.
Nix has a bug where it won't accept path:// located in a symlink.
This avoid this issue by always resolving symlinks as returned by
TemporaryDirectory.
2025-03-19 16:47:18 +01:00
Louis Opter
b52ec05497 clan-cli: don't try to delete a dir that doesn't exist in the pass vars backend
Do not crash in `delete_store`, if the machine has no vars, or the store
has been deleted already.
2025-03-19 10:53:38 +00:00
Louis Opter
f7bec766bc clan-cli: add delete and delete_store to StoreBase
- `delete` lets you delete a specific var under a specific generator;
- `delete_store` deletes an entire store.

The `delete` method could be useful to "garbage-collect" unused vars as
a machine's configuration changes.

The `delete_store` method can be used to delete all the vars for a
machine when the machine is deleted. The current behavior is to leave
everything behind.

Important point:

- `delete_store` needs to be idempotent because public and
  "private"/"secret" vars for a machine can share the same physical
  store (directory), and deleting either type of store (public or
  private) will delete both.
2025-03-19 10:53:38 +00:00
DavHau
db2e2e974c vars+facts: use bwrap only if supported 2025-03-09 13:52:15 +07:00
Michael Hoang
f0e5b14846 vars/sops: fix clan vars fix missing machine name in error message 2025-03-02 08:22:23 +07:00
Pablo Ovelleiro Corral
8aab746bd0 Apply suggestion 2025-02-25 08:51:51 +01:00
Pablo Ovelleiro Corral
d9e0741329 Fix exists() check for age files 2025-02-25 08:51:51 +01:00
lassulus
300aaa48e7 clan-cli: use new flake caching for machines 2025-02-23 15:58:03 +01:00
lassulus
90bd9217e3 vars fs: fix 2025-02-22 03:39:42 +00:00
Pablo Ovelleiro Corral
f28a38bbb3 Make store-backend configurable 2025-02-18 06:34:50 +01:00
Michael Hoang
4e2ae0f9f6 cli: add morph command 2025-02-16 21:31:28 +07:00
lassulus
2a8f40e91a clan_cli machines: use Flake instead of FlakeId 2025-02-07 06:26:09 +01:00
a-kenji
cf1a4f805c pkgs/cli: Rename create_file -> persist 2025-02-06 14:59:59 +00:00
Louis Opter
7be310062f clan-cli: honor clan.core.sops.defaultGroups option in vars fix 2025-02-04 03:13:20 +00:00
lassulus
db417ecd13 clan-cli vars upload: add optional --directory 2025-02-02 11:52:36 +00:00
Qubasa
84b8838084 clan-cli: Add ruff to devShell again. Add missing type annotations 2025-01-29 19:16:34 +07:00
a-kenji
fa54c0f1b5 Fix various typos 2025-01-22 13:19:28 +01:00
Johannes Kirschbauer
6bcd41d143 Vars/secrets-store: omit folder exists errors for secrets 2025-01-22 09:02:55 +00:00
Michael Hoang
7ee0e2afbf vars: support secrets for partitioning the disk 2025-01-21 11:13:51 +00:00
Pablo Ovelleiro Corral
038083bece Migrate borgbackup module to vars 2025-01-16 13:14:24 +01:00
Jörg Thalheim
3bcbc8fa3d reformat after update 2025-01-14 15:30:29 +01:00
DavHau
4a9ae3a45f vars: rename createFile -> persist 2025-01-11 04:19:46 +00:00
Johannes Kirschbauer
06869a4d27 API/vars: use string based interfaces to get and set vars to avoid state mutations 2025-01-10 12:06:01 +00:00
Johannes Kirschbauer
ecf37e02f8 API/vars: simplify get/set prompts 2025-01-07 11:09:58 +01:00
Jörg Thalheim
00a4f714ca fix spacing in error message 2024-12-25 22:55:03 +01:00
Jörg Thalheim
5e43571140 vars: commit validation hashes 2024-12-25 21:02:52 +01:00
Jörg Thalheim
64fa29d058 vars: fix path to validation hashes 2024-12-25 20:48:59 +01:00
Jörg Thalheim
7b3efcec06 vars/fact: isolate secret generation better from the system 2024-12-25 19:21:51 +00:00
Michael Hoang
0bf701de63 vars: make populate_dir a method of StoreBase 2024-12-22 05:53:26 +00:00
Michael Hoang
1d7e0c1c02 install: upload vars needed for activation for installation 2024-12-22 05:53:26 +00:00
clan-bot
5020f47a9b Merge pull request 'vars: allow setting files as needed for activation' (#2633) from vars-needed_activation into main 2024-12-19 12:26:58 +00:00