Commit Graph

50 Commits

Author SHA1 Message Date
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
Michael Hoang
e8ebd887d0 vars: don't use sops.secrets.*.restartUnits on macOS 2025-06-10 13:27:15 +07:00
Jörg Thalheim
8860a58deb vars: add restartUnits option
For secrets not part of the nix store there is no other way in NixOS to
restart a service after the secret is updated. One example is changing
password in userborn, which doesn't run as a activation script but as a
systemd service.
2025-05-28 16:44:19 +02:00
DavHau
fa011934f8 vars: cleanup sops file module 2025-05-12 15:30:23 +07:00
vdbe
26f336cf69 clanCore/vars/sops: add sops & switch to builtins.path 2025-05-04 08:08:58 +02:00
Raymond Barbiero
4117eb2f37 clanCore/vars: allow mode to be set
fmt
2025-04-25 11:29:43 +02:00
Michael Hoang
5e61a6e41d nixosModules/clanCore: support nix-darwin 2025-04-22 23:14:03 +10:00
Pablo Ovelleiro Corral
8ed186ce55 data-mesher: init module
Co-authored-by: Brian McGee <brian@bmcgee.ie>
2025-03-29 13:49:41 +00:00
Michael Hoang
4e2ae0f9f6 cli: add morph command 2025-02-16 21:31:28 +07:00
Michael Hoang
7ee0e2afbf vars: support secrets for partitioning the disk 2025-01-21 11:13:51 +00:00
clan-bot
4c284bb86b Merge pull request 'Migrate borgbackup module to vars' (#2741) from pinpox/clan-core:migrate-borgbackup-vars into main 2025-01-16 12:16:37 +00:00
Pablo Ovelleiro Corral
038083bece Migrate borgbackup module to vars 2025-01-16 13:14:24 +01:00
Jörg Thalheim
fb217cc4b2 remove flip functions from sops code 2025-01-15 13:59:49 +00:00
Jörg Thalheim
9b885f54af matrix-synapse: migrate to vars 2025-01-14 14:16:19 +00:00
lassulus
cc99a23ac2 pass move-mount-beneath: add more debug info 2025-01-12 11:17:22 +01:00
Johannes Kirschbauer
d46ffe9f4a Chore:_migrate 'machineName' to 'settings.machine.name' 2024-12-31 14:55:50 +01:00
Johannes Kirschbauer
315be52e34 Chore: init settings submdule, move clanDir into settings submodule 2024-12-31 14:18:09 +01:00
lassulus
8790b2163a vars password-store: fix usage with newer vars 2024-12-25 22:09:52 +01: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
b381a71266 vars sops: passthrough neededForUsers 2024-12-03 23:54:21 +01:00
lassulus
e6eaa3cc03 vars password-store: add neededForUsers option 2024-12-03 22:28:39 +01:00
Jörg Thalheim
d3babc9d69 fix sops deprecation warning 2024-12-03 11:13:17 +01:00
lassulus
8d31a710fe vars password-store: fix secretLocation again :) 2024-11-30 18:01:23 +01:00
lassulus
0afa050ca2 vars password-store: fix secretLocation 2024-11-30 17:24:17 +01:00
lassulus
8337a3ec41 vars: remove secretsUploadDirectory from common module 2024-11-28 16:38:06 +01:00
lassulus
aee27ba441 core password-store: define fileModule only if file is secret 2024-11-25 12:40:51 +01:00
lassulus
448e04a4ef core password-store: set default location to not conflict with facts 2024-11-23 10:38:14 +01:00
lassulus
fe4bf1c815 core password-store: fix secret location 2024-11-22 22:34:09 +01:00
lassulus
53f78d7959 clan-cli password-store: silence move-mount output 2024-11-22 22:34:09 +01:00
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
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
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
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
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
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