Johannes Kirschbauer
15fe06fbf5
feat(jsonschema): add test for attrsof submodule
2025-04-16 14:48:49 +02:00
Valentin Gagarin
06e27c84de
lib/jsonschema: make attrs required
...
Before the change, modules of the form
```nix
{ lib, ... }: {
foo.bar = lib.mkOption {
# ...
};
}
```
or
```nix
{ lib, ... }: {
foo = lib.mkOption {
type = lib.types.subModule {
bar = lib.mkOption {
# ...
};
};
};
}
```
would not render with `foo` as required, which is not faithful to the
module system's semantics.
This change also tests that fields with defaults are not marked required.
Note that submodule options cannot have their defaults rendered to JSON
schema, and are therefore always marked required.
Architecturally this change is rather unfortunate: So far the checks for
defaults happen in the rendering (using `isDefault`) and not in the parsing,
but here we're adding a field to `$exportedModuleInfo`. While strictly
speaking we probably don't want to consider requiredness as module-level
information, it seems more reasonable to me to do it that way since at
the JSON schema level we have lost the distinction between `attrs`,
`attrsOf`, `submodule`.
2025-04-16 13:20:00 +02:00
renovate[bot]
3323d2aee8
chore(deps): update dependency vite to v6.3.0
2025-04-16 09:50:12 +00:00
hsjobeki
e5ac0eb425
Merge pull request 'init(clanServices): create a new folder for migrated modules (clanServices); add a module as example' ( #3334 ) from hsjobeki/clan-core:clanServices-init into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3334
2025-04-16 09:44:57 +00:00
Johannes Kirschbauer
101648d657
init(clanServices): add zerotier boilerplate to clanServices
2025-04-16 11:34:58 +02:00
hsjobeki
3f33cb7dee
Merge pull request 'feat(scripts/update-vars): expose all configurables as arguments {repo_root, test_dir, check_attr}' ( #3333 ) from hsjobeki/clan-core:lib-cleanup into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3333
2025-04-16 08:50:44 +00:00
Johannes Kirschbauer
0bc2a068fe
chore(test/makeTestClan): document all options, remove magic specialArgs
2025-04-16 10:33:32 +02:00
Johannes Kirschbauer
7540242816
fix: rename folder lib/tests -> lib/test to be consistent with the attribute name
2025-04-16 10:04:31 +02:00
Johannes Kirschbauer
75932b7b7a
fixup: update commen in inventory example test
2025-04-16 10:02:20 +02:00
Johannes Kirschbauer
fa72ca3736
feat(scripts/update-vars): expose all configurables as arguments {repo_root, test_dir, check_attr}
2025-04-16 09:50:09 +02:00
hsjobeki
3865280619
Merge pull request 'revert vars: use writeShellApplication to shellcheck generators' ( #3331 ) from hsjobeki-patch-1 into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3331
2025-04-16 07:44:53 +00:00
hsjobeki
b48b30de0e
revert db50ffc4b7
...
revert vars: use writeShellApplication to shellcheck generators
Cannot re-generate the vars for data-mesher or any of our tests anymore
cc @DavHau @Qubasa Can we work together to fix this.
I like shellchecking but if we loose the ability to add tests thats unfortunate
This is blocking: the new 'restic' and 'zerotier' migrations because we need to write integration tests from the beginning.
2025-04-16 07:14:25 +00:00
hsjobeki
3ef83deeeb
Merge pull request 'tests(clan): move test-inventory.nix to clanLib. And name it 'makeTestClan'' ( #3330 ) from hsjobeki/clan-core:lib-cleanup into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3330
2025-04-15 16:27:09 +00:00
Johannes Kirschbauer
75c8541a8d
tests(clan): move test-inventory.nix to clanLib. And name it 'makeTestClan'
...
Exposing the function via clanLib makes it more accessible to clan modules
This allows each module to define its own test without needing to depend on any fileSystem path assumptions in the clan-core repo
2025-04-15 18:17:40 +02:00
hsjobeki
360f2fd7c9
Merge pull request 'feat(buildClan): expose {nixosModules,darwinModules} from clanInternals' ( #3329 ) from hsjobeki/clan-core:lib-cleanup into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3329
2025-04-15 15:45:01 +00:00
Michael Hoang
19f990d61a
Merge pull request 'clanCore: remove clan.core.module' ( #3327 ) from push-vwpyxmnwqttw into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3327
2025-04-15 15:27:24 +00:00
Johannes Kirschbauer
bc9bb5d405
feat(buildClan): expose {nixosModules,darwinModules} from clanInternals
...
These are the exact same modules that where used internally to construct the corresponding
'nixosConfiguration', 'darwinConfiguration'
They can be externally used, and would yield the same result
Given that you pass the same 'specialArgs'
2025-04-15 17:25:57 +02:00
Michael Hoang
4097da5ce7
clanCore: remove clan.core.module
2025-04-15 17:17:16 +02:00
hsjobeki
9ef7b442e0
Merge pull request 'refactor: buildClan output; output deferred modules instead of nixosConfig' ( #3323 ) from hsjobeki/clan-core:lib-cleanup into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3323
2025-04-15 14:47:49 +00:00
Michael Hoang
7ccb675ec5
Merge pull request 'machines: fix nixos-rebuild not getting retried' ( #3325 ) from push-vqmkpyrsvqqw into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3325
2025-04-15 14:31:47 +00:00
Michael Hoang
fc7a4d2b75
machines: fix nixos-rebuild not getting retried
2025-04-15 16:16:03 +02:00
Johannes Kirschbauer
256194575d
refactor(buildClan): simplify pkgs overriding logic
2025-04-15 16:05:57 +02:00
Johannes Kirschbauer
2ceefcd44d
refactor(buildClan): move modules into 'forName' and import the correct core module depending on class
2025-04-15 15:29:01 +02:00
Johannes Kirschbauer
bb0ca2065d
fixup(buildClan): use clan.inventory instead of refering to the clanInternals dumping ground within the module
2025-04-15 15:10:08 +02:00
Johannes Kirschbauer
d2c068c4a1
fixup(buildClan): split up the inner-module into: {forSystem, forName}
...
I am preparing this such that we can move the forName modules into the
defaults for the deferred module outputs and the forSystem modules are
added later and only for the 'configsPerSystem' where we actually need
the system modules
2025-04-15 15:02:37 +02:00
renovate[bot]
69a29c5c43
chore(deps): update data-mesher digest to 439f851
2025-04-15 12:30:10 +00:00
Johannes Kirschbauer
a0da225282
refactor: buildClan output; output deferred modules instead of nixosConfig
2025-04-15 14:25:02 +02:00
Michael Hoang
48740bbf07
Merge pull request 'build-clan: drop unused machinesFunc' ( #3324 ) from push-wktowzqkrvsp into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3324
2025-04-15 12:20:09 +00:00
Michael Hoang
9c317e8f3b
build-clan: drop unused machinesFunc
2025-04-15 13:30:28 +02:00
renovate[bot]
a2a78d302f
chore(deps): update treefmt-nix digest to 49d0555
2025-04-15 09:10:10 +00: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
Mic92
cf483421fa
Merge pull request 'Rework cache to use json instead of pickle' ( #3319 ) from validation-hash-2 into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3319
2025-04-15 07:11:03 +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
renovate[bot]
be54f619ad
chore(deps): update data-mesher digest to 0593ae1
2025-04-15 05:00:13 +00:00
renovate[bot]
2bf5128d5a
chore(deps): update sops-nix digest to 6115430
2025-04-14 23:10:10 +00:00
renovate[bot]
d49a0c9ee0
chore(deps): update typescript-eslint monorepo to v8.30.1
2025-04-14 20:20:16 +00:00
renovate[bot]
8a9b40b515
chore(deps): update typescript-eslint monorepo to v8.30.0
2025-04-14 17:20:17 +00:00
Jörg Thalheim
833798f650
test_vars_deployment: skip on macOS for now
...
we can not run vms on macOS at the moment.
2025-04-14 15:47:55 +00:00
Michael Hoang
8c56f17ae7
Merge pull request 'build-clan: expose Clan configuration as a module' ( #3303 ) from push-lsoyznsukqyq into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3303
2025-04-14 14:16:26 +00:00
Michael Hoang
1d159fb774
build-clan: expose Clan configuration as a module
2025-04-14 16:04:06 +02:00
Michael Hoang
3c869282b4
Merge pull request 'checks: test-backups -> backups' ( #3312 ) from push-nqvwsmllsyrx into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3312
2025-04-14 13:47:59 +00:00
Michael Hoang
11ed2f86d3
checks: test-backups -> backups
2025-04-14 15:39:25 +02:00
renovate[bot]
45d984287f
fix(deps): update dependency @tanstack/solid-query to v5.74.3
2025-04-14 13:00:13 +00:00
lassulus
2df82ae61f
clan_cli test_vars: start refactoring to use caching
2025-04-14 14:28:59 +02:00
lassulus
99238ff7d6
clan_cli machines update: cache values for faster eval
2025-04-14 14:28:59 +02:00
lassulus
da92c19367
clan_cli vars generate: prefetch all validationHashes for faster eval
2025-04-14 14:28:59 +02:00
Mic92
ab90987d17
Merge pull request 'don't error on macOS if sandbox for vars is missing' ( #3309 ) from macos-sandbox into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3309
2025-04-14 12:24:49 +00:00
Jörg Thalheim
4dc1e2cb3f
don't error on macOS if sandbox for vars is missing
2025-04-14 14:11:51 +02:00
Mic92
dc6cf1b673
Merge pull request 'cache nix_config' ( #3306 ) from nix-config into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3306
2025-04-14 11:23:33 +00:00
Jörg Thalheim
268be9e1f3
cache nix_config
...
We often call this several times during execution.
At the moment we only use system at the moment, which is unlikely to
change.
2025-04-14 13:13:49 +02:00