Commit Graph

35 Commits

Author SHA1 Message Date
lassulus
8f0c575425 password-store owner & group support 2024-11-16 01:18:59 +01:00
lassulus
faf0946c99 cli vars password-store: fix file locations 2024-11-14 12:07:52 +01:00
lassulus
2c66b36931 core vars: remove default for dirs 2024-11-13 13:23:42 +01:00
Jörg Thalheim
0a844097db vars: use explicit lib.mkOption function
the error messages where hard to read, when I tried to add a nested
option. Let's make the code easier to understand instead of saving some
characters to type.
2024-10-31 12:10:57 +01:00
Jörg Thalheim
0842b05687 vars: move owner/group to a sops namespace
we want to allow users to use this feature but do not want to use this
option in our own module because it's not supported by password store.
2024-10-31 12:10:57 +01:00
Louis Opter
4effc0c50e vars: add the user and group options on files
This changeset forwards the ownership control options from sops-nix.
2024-10-23 09:05:53 +00: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
6fc27d402b vars: allow setting a default for values 2024-09-17 21:11:38 +02:00
DavHau
85477d51f6 vars: get rid of meta.json 2024-09-12 16:52:44 +02:00
DavHau
e905407989 vars/sops: load sops info from nix instead of filesystem 2024-09-12 16:30:21 +02:00
a-kenji
6dd1a7395f vars: use correct paths for value accesses
Use correct paths for value accesses of vars under:

- `per-machine`
- `shared`
2024-09-11 19:02:43 +02:00
DavHau
dc4fcb7329 vars: new option prompts.<name>.createFile 2024-09-04 15:48:10 +02:00
DavHau
924f5e41c6 vars: global metadata paths for all store backends
This also changes the paths where sops stores teh secret -> all sops secrets will have to be re-generated
2024-09-03 16:30:01 +02:00
DavHau
62ccd0ed4b vars: introduce deploy=true/false for generated files 2024-09-01 14:32:46 +02:00
DavHau
f0a3eaca96 Reapply + Fix "vars: fix - upload machines own secrets only"
This reverts commit cb860f9a03.
2024-08-23 15:42:46 +02:00
DavHau
cb860f9a03 Revert "vars: fix - upload machines own secrets only"
This reverts commit 8d61b03f8d.
2024-08-21 14:59:05 +02:00
DavHau
8d61b03f8d vars: fix - upload machines own secrets only 2024-08-21 14:47:41 +02:00
a-kenji
63b5417c3d vars: fix using vars module with multiple machines
This filters the secrets to only include the secrets managed under `per-machine` and `shared`,
otherwise new deployments will fail, when using the vars module for multiple machines:

```
[vyr] /nix/store/[…]sops-install-secrets: failed to decrypt '/nix/store/[…]/sops/vars/per-machine/draper/garage/admin_token/secret': Error getting data key: 0 successful groups required, got 0
```

This doesn't fix all the edge cases with this approach.
We get a similar error if we deploy shared vars that are not
encrypted for our machine key. This needs to be addressed when
implementing the shared vars functionality.
2024-08-17 14:00:56 +00:00
DavHau
629861d404 tests: improve testing framework for impure vm tests
Also fix computet sops secret paths for vars
2024-08-04 13:40:12 +07:00
DavHau
d1c2f0b622 vars: introduce share flag 2024-08-03 15:26:53 +07:00
DavHau
71df351217 vars: fix bug when computing taarget path for sops 2024-07-29 12:09:59 +00:00
DavHau
395c5cbace vars/sops: fix loading of vars from directory structure 2024-07-29 18:01:26 +07:00
DavHau
5105ff14e0 vars: add support for password-store 2024-07-23 14:54:18 +07:00
DavHau
0acf9178c8 vars: implement prompts 2024-07-22 20:40:12 +07:00
DavHau
566c1403c0 vars: implement dependencies 2024-07-17 16:42:16 +07:00
Jörg Thalheim
7d028790d9 vars: remove deprecated nixos options 2024-07-15 20:41:27 +02:00
DavHau
7dbed61079 vars: implement secret generation 2024-07-11 11:37:17 +07:00
DavHau
941cf9fb9d vars: implement generating public variables via in_repo 2024-07-09 14:26:56 +07:00
DavHau
10bb3127a1 vars: add generator.runtimeInputs 2024-07-04 13:42:25 +07:00
DavHau
97bc973969 reference docs: add missing description fields and enforce it from now on 2024-07-04 13:34:55 +07:00
DavHau
3de7903317 vars: import by default & fix option rendering 2024-07-04 13:12:29 +07:00
DavHau
8f520f1806 vars: add generators.<name>.finalScript 2024-07-02 16:37:31 +07:00
DavHau
1235aa42d9 secrets: add settings, generator submodules, improve tests 2024-07-02 15:38:46 +07:00
DavHau
268adbe100 vars: simplify eval tests by using submodule directly 2024-07-02 13:55:00 +07:00
DavHau
dfcf4d8309 vars: init
- init eval tests
- init basic interface
2024-06-27 21:09:55 +07:00