Commit Graph

676 Commits

Author SHA1 Message Date
Johannes Kirschbauer
da98ca0f1c clanLib: remove unused mapInstances 2025-10-30 13:54:05 +01:00
Johannes Kirschbauer
1953540d08 tests: update inventory tests to use whole clan modules 2025-10-30 13:54:05 +01:00
Johannes Kirschbauer
2e55028a1b services: move into clan submodule 2025-10-30 13:53:49 +01:00
Johannes Kirschbauer
affb926450 services: remove duplicate module args 2025-10-30 10:10:55 +01:00
Johannes Kirschbauer
c7f65e929f inventoryAdapter: replace importedModulesEvaluated by equivalent config 2025-10-30 10:10:31 +01:00
hsjobeki
eb08803e2a revert bfb30251e6
revert lib: replace uniqueStrings after upstreamed

TODO: Reapply after 25.11 release
2025-10-30 08:29:43 +00:00
Johannes Kirschbauer
b7508b2b43 clan/checks: fix clanLib not checking 2025-10-28 11:46:49 +01:00
Johannes Kirschbauer
0060ead876 clan/checks: move into lib function; add tests 2025-10-28 09:40:31 +01:00
Johannes Kirschbauer
b3323007b2 test: update test filesets 2025-10-28 09:04:50 +01:00
hsjobeki
fb25ab028b Merge pull request 'services: add role settings with explicit warning' (#5676) from role-settings into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5676
2025-10-27 15:33:39 +00:00
Johannes Kirschbauer
bfb30251e6 lib: replace uniqueStrings after upstreamed 2025-10-27 14:00:46 +01:00
Johannes Kirschbauer
33115f76b7 services: add role settings with explicit warning 2025-10-27 13:31:44 +01:00
hsjobeki
6b3fd57174 Merge pull request 'extraModules: soft deprecation for string extraModules' (#5656) from inline into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5656
2025-10-27 12:12:17 +00:00
hsjobeki
9a442c15e9 Merge pull request 'docs: add experimental note to 'exports'' (#5662) from exports into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5662
2025-10-24 15:11:27 +00:00
Johannes Kirschbauer
24b94965d8 docs: add experimental note to 'exports' 2025-10-24 17:05:47 +02:00
Johannes Kirschbauer
e55a3b4fc6 clanTest: throw when usage of 'self' is triggered
That means we rely on a certain structure of the user flake
these assumptions cannot be made. Their flake can have any shape and is not controlled by us
2025-10-24 14:10:17 +02:00
Johannes Kirschbauer
6ee4657da3 extraModules: soft deprecation for string extraModules 2025-10-24 12:54:17 +02:00
Johannes Kirschbauer
f50475fcfd services: allow inline modules 2025-10-23 18:43:07 +02:00
pinpox
872a622f71 Add tests 2025-10-23 00:42:32 +02:00
pinpox
dc0b7fc3bf Add library function to read public vars 2025-10-22 19:56:10 +02:00
pinpox
9299cd9666 Add tld 2025-10-22 12:40:09 +02:00
Johannes Kirschbauer
02f3474a58 modules: add source to eval tests 2025-10-21 21:01:06 +02:00
Johannes Kirschbauer
c838e08d77 lib/modules: fixup paths 2025-10-21 20:41:28 +02:00
Johannes Kirschbauer
346e3d816a lib/modules: move modules out of lib 2025-10-21 19:35:50 +02:00
Johannes Kirschbauer
3ffad3f97f inventory: add docs for available specialArgs in service submodules 2025-10-20 16:53:56 +00:00
Johannes Kirschbauer
3d0c281fd6 inventory: add clanLib to specialArgs 2025-10-20 16:53:56 +00:00
Johannes Kirschbauer
064bc43f27 docs: add docs for finalSettings 2025-10-20 14:41:06 +02:00
Johannes Kirschbauer
f96a487bc3 inventory: expose finalSettings of every machine 2025-10-20 14:32:49 +02:00
Johannes Kirschbauer
4442cb2fe0 inventory: remove role.settings
Within a clan.service the module can access 'role.peer.settings' and 'role.peer.machine.jon.settings'
While the current machine is jon, accessing the role settings is arguably a design mistake.
I didn't catch that problem, unfortunately this might be a breaking change
2025-10-19 16:43:21 +02:00
Johannes Kirschbauer
afcc5d9e26 inventory: fix internal indentifier 2025-10-19 14:32:16 +02:00
Qubasa
18dc042a0b inventory: Add warning if manifest.readme is missing 2025-10-16 19:07:49 +02:00
pinpox
42e3fea9e5 clanServices: add desktop module 2025-10-14 16:02:20 +02:00
DavHau
7e00a08111 Merge pull request 'lib/test/container-test-driver: Fix extraPythonPackages support' (#5491) from ke-test-extra-packages into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5491
2025-10-14 13:33:08 +00:00
hsjobeki
d9f6b7e3fb Merge pull request 'api: prepare persistence_attributes' (#5453) from persistence_attributes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5453
2025-10-13 15:23:03 +00:00
Kenji Berthold
0343e4b91a Merge branch 'main' into ke-test-extra-packages 2025-10-13 12:31:37 +00:00
a-kenji
137d505c3b lib/test/container-test-driver: Fix extraPythonPackages support
Fix `extraPythonPackages` support in the container test driver.

It triggered the following warning from `nixpkgs`:
```
python3Packages = throw "do not use python3Packages when building Python packages, specify each used package as a separate argument"; # do not remove
```

The following `callPackage` usage triggered the `throw`:

```
hostPackages.python3.pkgs.callPackage
```

The change to a regular `callPackage` i`nvocation fixes this issue.

Added a container test with a popular package to ensure compatibility in the future.

Closes: #5459
2025-10-13 14:19:01 +02:00
Johannes Kirschbauer
347668a57f lib: remove unused facts utils 2025-10-12 17:49:05 +02:00
Johannes Kirschbauer
9b0557803e introspection: update test 2025-10-12 17:45:14 +02:00
Johannes Kirschbauer
1d38ffa9c2 inventory: unit test autoloading with a virtual fs 2025-10-12 16:32:55 +02:00
Johannes Kirschbauer
84d4660a8d inventory: wrap autoloaded machines with correct file 2025-10-11 15:57:42 +02:00
a-kenji
3088ce025b lib/introspection: Test skipping instrospection of oneOf
This builds on top of #5422.
And tests it's behavior.
2025-10-08 13:17:55 +02:00
a-kenji
8058a7c158 lib/instrospection: Skip either(oneOf)
For either(oneOf) types, we skip introspection as we cannot
determine which branch of the union was taken without more context
This *should* be safe, as it can currently mostly be triggered through
The `extraModules` setting of inventory modules.

Example:

```
importer.roles.default.extraModules = [
    ../../modules/nixos/common.nix
];
```

Error Message:

```
Traceback (most recent call last):
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/templates/handler.py", line 91, in machine_template
    yield dst_machine_dir
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_cli/machines/create.py", line 95, in create_machine
    inventory_store.write(inventory, message=f"machine '{machine_name}'")
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/persist/inventory_store.py", line 269, in write
    write_info = self._write_map()
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/persist/inventory_store.py", line 214, in _write_map
    current_priority = self._get_inventory_current_priority()
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/persist/inventory_store.py", line 206, in _get_inventory_current_priority
    return self._flake.select("clanInternals.inventoryClass.introspection")
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/flake/flake.py", line 1129, in select
    self.get_from_nix([selector])
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/flake/flake.py", line 1054, in get_from_nix
    raise ClanSelectError(
    ...<3 lines>...
    ) from e
clan_lib.flake.flake.ClanSelectError: Error on: $ clan select 'clanInternals.inventoryClass.introspection'
  Reason: Yet Unsupported type: either
Removing left-over machine directory: /tmp/hyperconfig/machines/trooo
Error on: $ clan select 'clanInternals.inventoryClass.introspection'
  Reason: Yet Unsupported type: either

```

Closes: #5387
2025-10-07 22:58:51 +02:00
Johannes Kirschbauer
359582118c docs: fix broken links 2025-10-05 14:14:12 +02:00
hsjobeki
c04e8b6ead Merge pull request 'docs: use absolute page URI' (#5368) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5368
2025-10-03 15:36:00 +00:00
Johannes Kirschbauer
08c2d574ce docs: use absolute page URI
This allows us to migrate to any framework that uses normal uri's
We just need to strip all .md endings in a simple grep command
2025-10-03 17:31:42 +02:00
Qubasa
2df96d3a9b inventory: Add roles.<name>.description option and a warning if it is not set 2025-10-02 18:57:55 +02:00
Johannes Kirschbauer
2dabff5db1 lib/clan: add checks 2025-10-02 18:21:37 +02:00
Johannes Kirschbauer
149e14e85d lib/introspection: backwards support older nixpkgs version with reduced features 2025-10-02 17:39:03 +02:00
Johannes Kirschbauer
6f5f182aef lib/introspect: fix list item meta 2025-10-02 16:40:29 +02:00
Johannes Kirschbauer
1a8131f17f lib/introspect: recurse for nested attrsOf 2025-10-01 16:56:53 +02:00