Commit Graph

35 Commits

Author SHA1 Message Date
Michael Hoang
a71a5880c1 treewide: reformat 2025-08-08 15:28:37 +10:00
DavHau
b91158f454 vars/interface: make type of dependencies configurable
One vars get lifted to the global scope, dependencies need to be structured differently, eg. categorized by instances
2025-07-15 13:41:05 +07:00
lassulus
bbb7773567 rename lingering clan.vars -> clan.core.vars 2025-07-07 00:59:52 +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
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
Jörg Thalheim
bdc0265ccd vars: improve warnings for non-public secrets 2025-05-12 12:06:05 +02:00
Jörg Thalheim
6f70a9ec01 vars: warn if mode/owner/user is used on non-secret var 2025-05-04 14:59:22 +02:00
Michael Hoang
f4b8f2e858 vars: fix default group on macOS 2025-04-22 23:39:47 +10:00
Michael Hoang
5e61a6e41d nixosModules/clanCore: support nix-darwin 2025-04-22 23:14:03 +10:00
Johannes Kirschbauer
9c3474f55f machine/vars: expose result direclty via vars submodule; keep deployment.data alias for now 2025-04-20 13:23:01 +02:00
lassulus
90bd9217e3 vars fs: fix 2025-02-22 03:39:42 +00:00
Jörg Thalheim
50e30a750d remove createFile legacy alias from vars/interface
it's hard to filter this out in nix. So instead we just drop this
option.
2025-01-31 10:29:35 +00:00
Jörg Thalheim
293d67d485 remove eval warning for createFile 2025-01-21 15:20:38 +01:00
Jörg Thalheim
9b885f54af matrix-synapse: migrate to vars 2025-01-14 14:16:19 +00:00
lassulus
70ff7fcc2f vars: allow setting files as needed for activation 2024-12-19 13:05:05 +01:00
lassulus
9cc3bdbc9f vars: eval finalScript lazy 2024-12-14 13:38:51 +01:00
lassulus
e9efe2f0d1 vars: export also file owner & group to deployment.json 2024-12-05 10:29:19 +01:00
lassulus
82fb1edc37 vars: add file mode 2024-12-04 23:30:39 +01:00
lassulus
e6eaa3cc03 vars password-store: add neededForUsers option 2024-12-03 22:28:39 +01:00
DavHau
5c5a87d416 vars: rename: invalidation -> validation 2024-11-29 17:23:31 +07:00
DavHau
fbbfcc0aa5 vars: generate docs for cli and module 2024-11-29 17:23:31 +07:00
lassulus
8337a3ec41 vars: remove secretsUploadDirectory from common module 2024-11-28 16:38:06 +01:00
Jörg Thalheim
cd2ea0d735 vars: add name to generators 2024-11-26 15:26:16 +01:00
DavHau
d4c8b2e4ed vars: implement invalidation mechanism
This adds options `invalidationData` to generators.

`invalidationData` can be used by an author of a generator to signal if a re-generation is required after updating the logic.

Whenever a generator with invalidation data is executed, a hash of that data is stored by the respective public and/or secret backends.

The stored hashes will be checked on future deployments, and a re-generation is triggered whenever a hash doesn't match what's defined in nix.
2024-11-20 16:27:22 +07: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
62ccd0ed4b vars: introduce deploy=true/false for generated files 2024-09-01 14:32:46 +02:00
DavHau
d1c2f0b622 vars: introduce share flag 2024-08-03 15:26:53 +07: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
941cf9fb9d vars: implement generating public variables via in_repo 2024-07-09 14:26:56 +07:00
DavHau
3de7903317 vars: import by default & fix option rendering 2024-07-04 13:12:29 +07:00
DavHau
dfcf4d8309 vars: init
- init eval tests
- init basic interface
2024-06-27 21:09:55 +07:00